#!/bin/sh #--- import colors and init-funcs --- . /usr/lib/init/colors.sh . /usr/lib/init/init-funcs.sh #------------------------------------ NTPD_OPTS="-N -p pool.ntp.org -n" if [ -f /etc/ntp.conf ]; then NTPD_OPTS="-N -n" fi start() { notify "Starting ntpd" /usr/bin/ntpd $NTPD_OPTS & check $? "start ntpd" echo $(pgrep ntpd) > /var/run/ntpd.pid return $? } stop() { notify "Stopping ntpd" kill $(cat /var/run/ntpd.pid) check $? "stop ntpd" rm /var/run/ntpd.pid &> /dev/null return $? } case "$1" in start|stop|restart|reload|help) "$1" ;; *) help return 1 esac return $?