blob: c211ac835ed71dbc10026a90a3bd5277b70292e1 [file] [log] [blame]
#!/bin/sh
[ -x /usr/sbin/ntpd ] || exit 0
[ -f /etc/ntpd.conf ] || exit 0
case "$1" in
start)
printf "Starting openntpd: "
start-stop-daemon -S -x /usr/sbin/ntpd -- -s -p /run/ntpd.pid
[ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
printf "Stopping openntpd: "
start-stop-daemon -K -q -p /run/ntpd.pid
[ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart)
"$0" stop
sleep 1
"$0" start
;;
*)
echo "Usage: $0 {start|stop|restart}"
;;
esac