Files
initscripts/usr/lib/init/services/ntpd.service
T
2025-07-25 17:33:19 +07:00

38 lines
657 B
Desktop File

#!/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 $?