1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
7 CONFIGFILE
=/var
/etc
/chrony.conf
10 local cfg
=$1 sourcetype
=$2 hostname minpoll maxpoll iburst
12 config_get hostname
"$cfg" hostname
13 [ -z "$hostname" ] && return
14 config_get minpoll
"$cfg" minpoll
15 config_get maxpoll
"$cfg" maxpoll
16 config_get_bool iburst
"$cfg" iburst
0
18 echo $sourcetype $hostname
19 [ -n "$minpoll" ] && echo minpoll
$minpoll
20 [ -n "$maxpoll" ] && echo maxpoll
$maxpoll
21 [ "$iburst" = "1" ] && echo iburst
26 local cfg
=$1 iface wan_iface wan6_iface subnet subnets subnets6
28 network_find_wan wan_iface true
29 network_find_wan6 wan6_iface true
30 config_get iface
"$cfg" interface
32 if [ "$wan_iface" = "$iface" ]; then
33 echo allow
>> $CONFIGFILE
35 network_get_subnets subnets
$iface || \
36 network_get_subnets subnets6
$iface ||
continue
37 for subnet
in $subnets $subnets6; do
38 echo allow
$subnet >> $CONFIGFILE
44 local cfg
=$1 threshold limit
46 config_get threshold
"$cfg" threshold
47 config_get limit
"$cfg" limit
48 [ -z "$threshold" -o -z "$limit" ] && return
49 echo makestep
$threshold $limit >> $CONFIGFILE
53 .
/lib
/functions
/network.sh
56 procd_set_param
command $PROG -n -f $CONFIGFILE
57 procd_set_param
file $CONFIGFILE
58 procd_set_param
file /etc
/chrony
/chrony.conf
61 echo include
/etc
/chrony
/chrony.conf
> $CONFIGFILE
64 config_foreach handle_source server server
65 config_foreach handle_source pool pool
66 config_foreach handle_source peer peer
67 config_foreach handle_allow allow
68 config_foreach handle_makestep makestep