aboutsummaryrefslogblamecommitdiffstats
path: root/main/sntpc/sntpc.initd
blob: a62c6d3527aa4193dc8890af480286cd88183bb0 (plain) (tree)
1
2
3
4
5
6
7
8






                      
                      






















                                                                
#!/sbin/runscript

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 --name sntpc \
			--exec ${DAEMON} -- \
			-i ${SNTPC_INTERVAL} $opts ${SNTPC_HOST}
	eend $?
}

stop() {
	ebegin "Stopping ${NAME}"
		start-stop-daemon --stop --quiet \
			--exec ${DAEMON} 
	eend $?
}