wok-current annotate fcron/stuff/fcron @ rev 24591

updated genext2fs (1.4.1 -> 1.5.0)
author Hans-G?nter Theisgen
date Mon Feb 28 17:48:46 2022 +0100 (2022-02-28)
parents 7f188676b59c
children
rev   line source
erjo@4192 1 #!/bin/sh
Hans-G?nter@24542 2 # /etc/init.d/fcron : Start, stop and restart fcron on SliTaz,
Hans-G?nter@24542 3 # at boot time or with the command line.
erjo@4192 4 #
Hans-G?nter@24542 5 # To start fcron server at boot time, just put fcron in the RUN_DAEMONS
erjo@4192 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
erjo@4192 7 #
erjo@4192 8 . /etc/init.d/rc.functions
erjo@4192 9 . /etc/daemons.conf
erjo@4192 10
erjo@4192 11 NAME=fcron
al@19159 12 DESC="$(_ '%s daemon' Cron)"
erjo@4192 13 DAEMON=/usr/bin/fcron
Hans-G?nter@24542 14 OPTIONS="$FCRON_OPTIONS"
Hans-G?nter@24542 15 [ -n "$FCRON_OPTIONS" ] || OPTIONS="-b"
erjo@4192 16 PIDFILE=/var/run/fcron.pid
erjo@4192 17
erjo@4192 18 case "$1" in
Hans-G?nter@24542 19 (start)
Hans-G?nter@24542 20 if active_pidfile $PIDFILE fcron
Hans-G?nter@24542 21 then
Hans-G?nter@24542 22 _ '%s is already running.' $NAME
Hans-G?nter@24542 23 exit 1
Hans-G?nter@24542 24 fi
Hans-G?nter@24542 25 action 'Starting %s: %s...' "$DESC" $NAME
Hans-G?nter@24542 26 $DAEMON $OPTIONS
Hans-G?nter@24542 27 status
Hans-G?nter@24542 28 ;;
Hans-G?nter@24542 29 (stop)
Hans-G?nter@24542 30 if ! active_pidfile $PIDFILE fcron
Hans-G?nter@24542 31 then
Hans-G?nter@24542 32 _ '%s is not running.' $NAME
Hans-G?nter@24542 33 exit 1
Hans-G?nter@24542 34 fi
Hans-G?nter@24542 35 action 'Stopping %s: %s...' "$DESC" $NAME
Hans-G?nter@24542 36 kill $(cat $PIDFILE)
Hans-G?nter@24542 37 status
Hans-G?nter@24542 38 ;;
Hans-G?nter@24542 39 (restart)
Hans-G?nter@24542 40 if ! active_pidfile $PIDFILE fcron
Hans-G?nter@24542 41 then
Hans-G?nter@24542 42 _ '%s is not running.' $NAME
Hans-G?nter@24542 43 exit 1
Hans-G?nter@24542 44 fi
Hans-G?nter@24542 45 action 'Restarting %s: %s...' "$DESC" $NAME
Hans-G?nter@24542 46 kill $(cat $PIDFILE)
Hans-G?nter@24542 47 sleep 2
Hans-G?nter@24542 48 $DAEMON $OPTIONS
Hans-G?nter@24542 49 status
Hans-G?nter@24542 50 ;;
Hans-G?nter@24542 51 (*)
Hans-G?nter@24542 52 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
Hans-G?nter@24542 53 newline
Hans-G?nter@24542 54 exit 1
Hans-G?nter@24542 55 ;;
erjo@4192 56 esac
erjo@4192 57
erjo@4192 58 exit 0