commit 204f1d7

hovercats  ·  2024-04-08 08:12:13 +0000 UTC
parent 42ea8ca
list actived services with -a if ran without an argument
1 files changed,  +9, -4
M rcsm
M rcsm
+9, -4
 1@@ -24,12 +24,17 @@ fn run {
 2 
 3 switch($1) {
 4 case -a
 5-	if (test -e $basedir/avail/$2) {
 6-		ln -sf $basedir/avail/$2 $basedir/run/
 7+	if (test -z $2) {
 8+		find $basedir/run -type l
 9 	}
10 	if not {
11-		printf 'Service not found\n'
12-		exit 1
13+		if (test -e $basedir/avail/$2) {
14+			ln -sf $basedir/avail/$2 $basedir/run/
15+		}
16+		if not {
17+			printf 'Service not found\n'
18+			exit 1
19+		}
20 	}
21 case -c
22 	test -d $basedir/run || mkdir -p $basedir/run