commit c3ac5ec06169db3983a0ee73891fa53d708e0dd1 parent 6c533213331e1367a698e2e08de58bbd0ab5d922 Author: mrgrouse <bdmfegys@duck.com> Date: Sun, 27 Jul 2025 19:14:32 -0400 create svc.e, the interface to the svc-execline system Diffstat:
| A | svc/svc.e | | | 42 | ++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 42 insertions(+), 0 deletions(-)
diff --git a/svc/svc.e b/svc/svc.e @@ -0,0 +1,42 @@ +#!/bin/execlineb -S3 +backtick BASENAME { basename $0 } +define BASEDIR "/etc/svc.d" + +case -N -- $1 +{ # open case + "-a" { # open -a + if { eltest $# -eq 0 -a -e avail/${2} } + # then + { + foreground { + ln -sf "../avail/${2}" "run/${2}" + } printf "%s: '%s' activated.\n" $BASENAME ${2} + } + } # close -a + "-d" {} + # not sure if this regex works, will check later.lolz + "-s|-k" { svc.doservice ${1} ${2} } + "-l" { ls "${BASEDIR}/avail" } + "-r" { #open -r + ifte { eltest $# -gt 1 } + # then + { + set -x + foreground { $BASENAME -k ${2} } + svc -s ${2} + } + # else + { + foreground { + printf "%s: please give a service name.\n" ${BASENAME} + } exit 1 + } + } # close -r + +} # close case +# default case +{ + foreground { printf "usage: %s [-askdlr] [service]\n" ${BASENAME} } exit 1 +} + # dont know if this is reachable but hey might as well +exit 0