You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
619 B
Plaintext
32 lines
619 B
Plaintext
13 years ago
|
#!/bin/sh /etc/rc.common
|
||
|
# Copyright (C) 2011 OpenWrt.org
|
||
|
|
||
|
START=98
|
||
|
|
||
11 years ago
|
USE_PROCD=1
|
||
|
PROG=/usr/sbin/ntpd
|
||
13 years ago
|
SERVICE_PID_FILE=/var/run/sysntpd.pid
|
||
13 years ago
|
|
||
11 years ago
|
start_service() {
|
||
13 years ago
|
local peers
|
||
12 years ago
|
local args="-n"
|
||
|
local enable_server
|
||
13 years ago
|
|
||
|
config_load system
|
||
12 years ago
|
config_get peers ntp server
|
||
|
config_get_bool enable_server ntp enable_server 0
|
||
|
|
||
11 years ago
|
[ $enable_server -eq 0 -a -z "$peers" ] && return
|
||
13 years ago
|
|
||
11 years ago
|
procd_open_instance
|
||
|
procd_set_param command "$PROG" -n
|
||
|
[ $enable_server -ne 0 ] && procd_append_param command -l
|
||
|
[ -n "$peers" ] && {
|
||
13 years ago
|
local peer
|
||
|
for peer in $peers; do
|
||
11 years ago
|
procd_append_param command -p $peer
|
||
13 years ago
|
done
|
||
11 years ago
|
}
|
||
|
procd_close_instance
|
||
13 years ago
|
}
|