mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-15 06:35:20 +02:00
f3e5707f9a
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28835 3c298f89-4303-0410-b956-a3cf2f4a3e73
36 lines
505 B
Bash
Executable File
36 lines
505 B
Bash
Executable File
#!/bin/sh /etc/rc.common
|
|
# Copyright (C) 2011 OpenWrt.org
|
|
|
|
START=98
|
|
|
|
SERVICE_DAEMONIZE=1
|
|
SERVICE_WRITE_PID=1
|
|
SERVICE_PID_FILE=/var/run/sysntpd.pid
|
|
|
|
start() {
|
|
[ -x $PROG ] || return 1
|
|
|
|
local peers
|
|
|
|
getpeers() {
|
|
config_get peers "$1" server
|
|
}
|
|
|
|
config_load system
|
|
config_foreach getpeers timeserver
|
|
|
|
if [ -n "$peers" ]; then
|
|
local peer
|
|
local args="-n"
|
|
for peer in $peers; do
|
|
append args "-p $peer"
|
|
done
|
|
|
|
service_start /usr/sbin/ntpd $args
|
|
fi
|
|
}
|
|
|
|
stop() {
|
|
service_stop /usr/sbin/ntpd
|
|
}
|