commit 18ff92a

hovercats  ·  2024-03-26 00:33:54 +0000 UTC
parent 87aae67
exit if service file isnt found or executable
1 files changed,  +3, -3
M rcsm
M rcsm
+3, -3
 1@@ -12,13 +12,13 @@ fn usage {
 2 fn run {
 3 	if (test -z $2) {
 4 		for (serv in $basedir/run/*) {
 5-			test -x $serv || printf 'Servicefile not executable\n'
 6+			test -x $serv || printf 'Servicefile not executable\n' && exit 1
 7 			$serv $1 >/dev/null >[2=1]  &
 8 		}
 9 	}
10 	if not {
11-		test -e $basedir/avail/$2 || printf 'Service not found\n'
12-		test -x $basedir/avail/$2 || printf 'Servicefile not executable\n'
13+		test -e $basedir/avail/$2 || printf 'Service not found\n' && exit 1
14+		test -x $basedir/avail/$2 || printf 'Servicefile not executable\n' && exit 1
15 		$basedir/avail/$2 $1 >/dev/null >[2=1]  &
16 	}
17 }