mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-04 20:29:09 +01:00
36f101a0eb
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
43 lines
699 B
Bash
43 lines
699 B
Bash
#!/bin/sh
|
|
|
|
# Start/stop/restart the network time protocol daemon
|
|
|
|
# Written for Slackware Linux by Robby Workman <http://rlworkman.net>
|
|
# (by modifying one of Pat's scripts)
|
|
|
|
# Add -s to the command to set the time at startup
|
|
|
|
openntpd_start() {
|
|
if [ -x ${BIN} ]; then
|
|
echo "Starting openntpd daemon: ${BIN}"
|
|
${BIN} -p /var/run/openntpd.pid
|
|
fi
|
|
}
|
|
|
|
openntpd_stop() {
|
|
echo "Stopping openntpd daemon..."
|
|
pkill -x $(basename ${BIN})
|
|
}
|
|
|
|
openntpd_restart() {
|
|
openntpd_stop
|
|
sleep 1
|
|
openntpd_start
|
|
}
|
|
|
|
BIN=/usr/sbin/openntpd
|
|
|
|
case "$1" in
|
|
'start')
|
|
openntpd_start
|
|
;;
|
|
'stop')
|
|
openntpd_stop
|
|
;;
|
|
'restart')
|
|
openntpd_restart
|
|
;;
|
|
*)
|
|
echo "usage $0 start|stop|restart"
|
|
;;
|
|
esac
|