buildroot/package/openntpd/S49ntp
Carlos Santos 0100c6962d openntpd: don't test if the binary exists in the init script
The test doesn't make sense. It just exits without any error if the
binary doesn't exist, which is silly.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-04-16 07:34:52 +02:00

25 lines
437 B
Bash
Executable file

#!/bin/sh
[ -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