mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-19 14:56:46 +02:00
31 lines
482 B
Bash
31 lines
482 B
Bash
#!/sbin/openrc-run
|
|
|
|
NAME=sntpc
|
|
DAEMON=/usr/sbin/$NAME
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
}
|
|
|
|
start() {
|
|
local msg opts
|
|
if [ "$SNTPC_INTERVAL" = "0" ]; then
|
|
msg="Setting time from NTP source"
|
|
else
|
|
msg="Starting ${NAME}"
|
|
opts="-d"
|
|
fi
|
|
ebegin "$msg"
|
|
start-stop-daemon --start --quiet \
|
|
--exec ${DAEMON} -- \
|
|
-i ${SNTPC_INTERVAL} $opts ${SNTPC_HOST}
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping ${NAME}"
|
|
start-stop-daemon --stop --quiet \
|
|
--exec ${DAEMON}
|
|
eend $?
|
|
}
|