slackbuilds_ponce/network/openntpd/rc.ntpd

42 lines
655 B
Text
Raw Normal View History

2010-05-11 15:01:33 +02:00
#!/bin/sh
2010-05-11 15:01:33 +02:00
# Start/stop/restart the network time protocol daemon
2010-05-11 15:01:33 +02:00
# Written for Slackware Linux by Robby Workman <http://rlworkman.net>
# ## (by modifying one of Pat's scripts)
2010-05-11 15:01:33 +02:00
# Add -s to the command to set the time at startup
ntpd_start() {
if [ -x /usr/sbin/ntpd ]; then
echo "Starting ntpd daemon: /usr/sbin/ntpd "
/usr/sbin/ntpd 2> /dev/null
sleep 1
fi
}
ntpd_stop() {
echo "Stopping ntpd daemon..."
killall ntpd 2> /dev/null
}
ntpd_restart() {
ntpd_stop
sleep 1
ntpd_start
}
case "$1" in
'start')
ntpd_start
;;
'stop')
ntpd_stop
;;
'restart')
ntpd_restart
;;
*)
echo "usage $0 start|stop|restart"
esac