updated on Wed Jan 18 04:00:29 UTC 2012
[aur-mirror.git] / htpdate / htpdate
blob9aa2b3f1aed8a3673b52cc38dce45f0d9d5f8285
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 # Include htpdate defaults if available
7 if [ -f /etc/default/htpdate ] ; then
8 . /etc/default/htpdate
9 fi
11 PID=`pidof -o %PPID /usr/bin/htpdate`
12 case "$1" in
13 start)
14 stat_busy "Starting Htpdate Daemon"
15 [ -z "$PID" ] && /usr/bin/htpdate $DAEMON_OPTS &>/dev/null
16 if [ $? -gt 0 ]; then
17 stat_fail
18 else
19 add_daemon htpdate
20 stat_done
23 stop)
24 stat_busy "Stopping Htpdate Daemon"
25 [ ! -z "$PID" ] && kill -INT $PID &>/dev/null && rm /var/run/htpdate.pid
26 if [ $? -gt 0 ]; then
27 stat_fail
28 else
29 rm_daemon htpdate
30 stat_done
33 restart)
34 $0 stop
35 sleep 3
36 $0 start
39 echo "usage: $0 {start|stop|restart}"
40 esac
41 exit 0