added ntpd

This commit is contained in:
wt committed 2025-07-25 17:27:40 +07:00
1 parent 1db34c6ec6
commit 87d86330da
4 files changed
+56 -15

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
#!/bin/sh
#--- import colors and init-funcs ---
. /usr/lib/init/colors.sh
. /usr/lib/init/init-funcs.sh
#------------------------------------
NTPD_OPTS=""
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 $?