commit 108d0d6

hovercats  ·  2023-09-01 18:22:09 +0000 UTC
parent 37d7adf
it is now possible to run a activated service.
1 files changed,  +18, -0
M rcsm
M rcsm
+18, -0
 1@@ -7,6 +7,20 @@ fn usage {
 2 	exit 0
 3 }
 4 
 5+fn run {
 6+	if (test -z $2) {
 7+		test -e $basedir/avail/$2 || printf 'Service not found\n'
 8+		test -x $basedir/avail/$2 || printf 'Servicefile not executable\n'
 9+		$basedir/avail/$2 $1 &
10+	}
11+	if not {
12+		for (serv in $basedir/run) {
13+			test -x $serv || printf 'Servicefile not executable\n'
14+			$basedir/run/$2 $1 &
15+		}
16+	}
17+}
18+
19 switch($1) {
20 case -a
21 	if (test -e $basedir/avail/$2) {
22@@ -25,6 +39,10 @@ case -h
23 	usage
24 case -l
25 	find $basedir/avail -type -f
26+case -s
27+	run $1 $2
28+case -k
29+	run $1 $2
30 case *
31 	printf 'Invalid argument\n'
32 	usage