diff options
Diffstat (limited to 'source/ap/at/rc.atd')
-rw-r--r-- | source/ap/at/rc.atd | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source/ap/at/rc.atd b/source/ap/at/rc.atd new file mode 100644 index 00000000..2e06f169 --- /dev/null +++ b/source/ap/at/rc.atd @@ -0,0 +1,39 @@ +#!/bin/sh +# /etc/rc.d/rc.atd - start/stop the at daemon + +# To change the default options, edit /etc/default/atd. +if [ -r /etc/default/atd ]; then + . /etc/default/atd +fi + +start_atd() { + if ! /usr/bin/pgrep --ns $$ --exact atd 1> /dev/null 2> /dev/null ; then + echo "Starting atd: /usr/sbin/atd $ATD_OPTS" + /usr/sbin/atd $CROND_OPTS + fi +} + +stop_atd() { + echo "Stopping atd." + /usr/bin/pkill --ns $$ --exact atd 2> /dev/null +} + +restart_atd() { + stop_atd + sleep 1 + start_atd +} + +case "$1" in +'start') + start_atd + ;; +'stop') + stop_atd + ;; +'restart') + restart_atd + ;; +*) + echo "usage $0 start|stop|restart" +esac |