From: David Stes <55844484+cstes@users.noreply.github.com> Date: Tue, 4 May 2021 21:35:10 +0000 (+0200) Subject: Add SunOS case to sysVinitLauncher (#11) X-Git-Tag: ver3_3_1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34898b7b86aef6078d562392de4de8088bd1ee29;p=thirdparty%2Ffcron.git Add SunOS case to sysVinitLauncher (#11) --- diff --git a/script/sysVinit-launcher.in b/script/sysVinit-launcher.in index 2e813bd..56c4217 100755 --- a/script/sysVinit-launcher.in +++ b/script/sysVinit-launcher.in @@ -33,21 +33,29 @@ TARGETS="{start|stop|status|restart|reload|force-reload}" # Source function library. # the 'status' function is considered to be here only if $FUNCTION = 1 and # the condrestart action is only implemented in that case -if test -f /etc/init.d/functions; then +if test -x /usr/bin/uname && test `/usr/bin/uname` = SunOS; then + STARTCMD="$EXEC -b" + STOPCMD="pkill -TERM fcron" + FINALECHO=":" + ECHON="echo" +elif test -f /etc/init.d/functions; then . /etc/init.d/functions FUNCTION=1 STARTCMD="daemon $EXEC -b" STOPCMD="killproc fcron" FINALECHO="echo" + ECHON="echo -n" TARGETS="{start|stop|status|restart|condrestart|try-restart|reload|force-reload}" elif start-stop-daemon --version > /dev/null; then STARTCMD="start-stop-daemon --start --quiet --exec $EXEC -- -b" STOPCMD="start-stop-daemon --stop --quiet --exec $EXEC" FINALECHO="echo ." + ECHON="echo -n" else STARTCMD="$EXEC -b" STOPCMD="killall -TERM $EXEC" FINALECHO="echo ." + ECHON="echo -n" fi RETVAL=0 @@ -60,7 +68,7 @@ case "$1" in status fcron >/dev/null 2>&1 && exit 0 fi [ -x "$EXEC" ] || exit 5 - echo -n "Starting fcron" + $ECHON "Starting fcron" $STARTCMD RETVAL=$? if test -d /var/lock/subsys/; then @@ -72,7 +80,7 @@ case "$1" in if test $FUNCTION -eq 1; then status fcron >/dev/null 2>&1 || exit 0 fi - echo -n "Shutting down fcron" + $ECHON "Shutting down fcron" $STOPCMD RETVAL=$? if test -d /var/lock/subsys/; then