wok diff fcron/stuff/fcron @ rev 25037

Up glza (0.11.4)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 21 21:38:29 2022 +0000 (2022-05-21)
parents 7f188676b59c
children
line diff
     1.1 --- a/fcron/stuff/fcron	Thu May 26 20:16:45 2016 +0300
     1.2 +++ b/fcron/stuff/fcron	Sat May 21 21:38:29 2022 +0000
     1.3 @@ -1,8 +1,8 @@
     1.4  #!/bin/sh
     1.5 -# /etc/init.d/fcron : Start, stop and fcron on SliTaz, at
     1.6 -# boot time or with the command line.
     1.7 +# /etc/init.d/fcron : Start, stop and restart fcron on SliTaz,
     1.8 +# at boot time or with the command line.
     1.9  #
    1.10 -# To start SSH server at boot time, just put fcron in the $RUN_DAEMONS
    1.11 +# To start fcron server at boot time, just put fcron in the RUN_DAEMONS
    1.12  # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
    1.13  #
    1.14  . /etc/init.d/rc.functions
    1.15 @@ -11,44 +11,48 @@
    1.16  NAME=fcron
    1.17  DESC="$(_ '%s daemon' Cron)"
    1.18  DAEMON=/usr/bin/fcron
    1.19 -OPTIONS=-b
    1.20 +OPTIONS="$FCRON_OPTIONS"
    1.21 +[ -n "$FCRON_OPTIONS" ] || OPTIONS="-b"
    1.22  PIDFILE=/var/run/fcron.pid
    1.23  
    1.24  case "$1" in
    1.25 -  start)
    1.26 -    if active_pidfile $PIDFILE fcron ; then
    1.27 -      _ '%s is already running.' $NAME
    1.28 -      exit 1
    1.29 -    fi
    1.30 -    action 'Starting %s: %s...' "$DESC" $NAME
    1.31 -    $DAEMON $OPTIONS
    1.32 -    status
    1.33 -    ;;
    1.34 -  stop)
    1.35 -    if ! active_pidfile $PIDFILE fcron ; then
    1.36 -      _ '%s is not running.' $NAME
    1.37 -      exit 1
    1.38 -    fi
    1.39 -    action 'Stopping %s: %s...' "$DESC" $NAME
    1.40 -    kill $(cat $PIDFILE)
    1.41 -    status
    1.42 -    ;;
    1.43 -  restart)
    1.44 -    if ! active_pidfile $PIDFILE fcron ; then
    1.45 -      _ '%s is not running.' $NAME
    1.46 -      exit 1
    1.47 -    fi
    1.48 -    action 'Restarting %s: %s...' "$DESC" $NAME
    1.49 -    kill $(cat $PIDFILE)
    1.50 -    sleep 2
    1.51 -    $DAEMON $OPTIONS
    1.52 -    status
    1.53 -    ;;
    1.54 -  *)
    1.55 -    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.56 -    newline
    1.57 -    exit 1
    1.58 -    ;;
    1.59 +	(start)
    1.60 +		if active_pidfile $PIDFILE fcron
    1.61 +		  then
    1.62 +			_ '%s is already running.' $NAME
    1.63 +			exit 1
    1.64 +		fi
    1.65 +		action 'Starting %s: %s...' "$DESC" $NAME
    1.66 +		$DAEMON $OPTIONS
    1.67 +		status
    1.68 +		;;
    1.69 +	(stop)
    1.70 +		if ! active_pidfile $PIDFILE fcron
    1.71 +		  then
    1.72 +			_ '%s is not running.' $NAME
    1.73 +			exit 1
    1.74 +		fi
    1.75 +		action 'Stopping %s: %s...' "$DESC" $NAME
    1.76 +		kill $(cat $PIDFILE)
    1.77 +		status
    1.78 +		;;
    1.79 +	(restart)
    1.80 +		if ! active_pidfile $PIDFILE fcron
    1.81 +		  then
    1.82 +			_ '%s is not running.' $NAME
    1.83 +			exit 1
    1.84 +		fi
    1.85 +		action 'Restarting %s: %s...' "$DESC" $NAME
    1.86 +		kill $(cat $PIDFILE)
    1.87 +		sleep 2
    1.88 +		$DAEMON $OPTIONS
    1.89 +		status
    1.90 +		;;
    1.91 +	(*)
    1.92 +		emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.93 +		newline
    1.94 +		exit 1
    1.95 +		;;
    1.96  esac
    1.97  
    1.98  exit 0