2014-06-11 13:33:15 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
[ -x /usr/sbin/ntpd ] || exit 0
|
|
|
|
[ -f /etc/ntpd.conf ] || exit 0
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
2015-10-03 23:29:57 +02:00
|
|
|
printf "Starting openntpd: "
|
2016-01-13 13:29:04 +01:00
|
|
|
start-stop-daemon -S -x /usr/sbin/ntpd -- -s -p /run/ntpd.pid
|
2014-10-26 18:41:43 +01:00
|
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
2014-06-11 13:33:15 +02:00
|
|
|
;;
|
|
|
|
stop)
|
2015-10-03 23:29:57 +02:00
|
|
|
printf "Stopping openntpd: "
|
2015-01-09 00:06:37 +01:00
|
|
|
start-stop-daemon -K -q -p /run/ntpd.pid
|
2014-10-26 18:41:43 +01:00
|
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
2014-06-11 13:33:15 +02:00
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
"$0" stop
|
|
|
|
sleep 1
|
|
|
|
"$0" start
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
|
|
;;
|
|
|
|
esac
|