0ae1ab3ed5
Also: * Add hash file * Tweak the initscript to use a pidfile to avoid nasty warnings Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
26 lines
468 B
Bash
Executable File
26 lines
468 B
Bash
Executable File
#!/bin/sh
|
|
|
|
[ -x /usr/sbin/ntpd ] || exit 0
|
|
[ -f /etc/ntpd.conf ] || exit 0
|
|
|
|
case "$1" in
|
|
start)
|
|
echo -n "Starting openntpd: "
|
|
start-stop-daemon -S -x /usr/sbin/ntpd -- -p /run/ntpd.pid
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
;;
|
|
stop)
|
|
echo -n "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
|