176dea44a8
and replace it with a '0' count value. don't ignore config file count setting git-svn-id: svn://svn.openwrt.org/openwrt/packages@10923 3c298f89-4303-0410-b956-a3cf2f4a3e73
29 lines
499 B
Bash
29 lines
499 B
Bash
#!/bin/sh /etc/rc.common
|
|
# Copyright (C) 2008 OpenWrt.org
|
|
|
|
START=80
|
|
|
|
config_cb() {
|
|
local cfg="$CONFIG_SECTION"
|
|
local cfgtype
|
|
config_get cfgtype "$cfg" TYPE
|
|
|
|
if [ "$cfgtype" = ntpclient ]
|
|
then
|
|
config_get hostname $cfg hostname
|
|
config_get port $cfg port
|
|
config_get count $cfg count
|
|
|
|
ps | grep -q 'bin/[n]tpclient' || \
|
|
/usr/sbin/ntpclient -s -c ${count:-1} -l -h $hostname -p ${port:-123} 2>&- >&- &
|
|
fi
|
|
}
|
|
|
|
start() {
|
|
config_load ntpclient&
|
|
}
|
|
|
|
stop() {
|
|
killall ntpclient 2>&- >&-
|
|
}
|