OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 27... | Line 27... | |||
27 | [ "$duplicate" = 0 ] && server="$server $ntpserver" |
27 | [ "$duplicate" = 0 ] && server="$server $ntpserver" |
|
28 | done |
28 | done |
|
29 | } |
29 | } |
|
Line 30... | Line 30... | |||
30 | |
30 | |
|
31 | validate_ntp_section() { |
31 | validate_ntp_section() { |
|
32 | uci_load_validate system timeserver "$1" "$2" \ |
32 | uci_validate_section system timeserver "${1}" \ |
|
33 | 'server:list(host)' 'enabled:bool:1' 'enable_server:bool:0' 'use_dhcp:bool:1' 'dhcp_interface:list(string)' |
33 | 'server:list(host)' 'enabled:bool:1' 'enable_server:bool:0' 'use_dhcp:bool:1' 'dhcp_interface:list(string)' |
|
Line 34... | Line 34... | |||
34 | } |
34 | } |
|
35 | |
35 | |
|
Line 36... | Line 36... | |||
36 | start_ntpd_instance() { |
36 | start_service() { |
|
37 | local peer |
37 | local server enabled enable_server use_dhcp dhcp_interface peer |
|
38 | |
38 | |
|
39 | [ "$2" = 0 ] || { |
39 | validate_ntp_section ntp || { |
|
Line 40... | Line 40... | |||
40 | echo "validation failed" |
40 | echo "validation failed" |
|
Line 56... | Line 56... | |||
56 | done |
56 | done |
|
57 | procd_set_param respawn |
57 | procd_set_param respawn |
|
58 | procd_close_instance |
58 | procd_close_instance |
|
59 | } |
59 | } |
|
Line 60... | Line -... | |||
60 | |
- | ||
61 | start_service() { |
- | ||
62 | validate_ntp_section ntp start_ntpd_instance |
- | ||
63 | } |
- | ||
64 | |
60 | |
|
65 | service_triggers() { |
61 | service_triggers() { |
|
Line 66... | Line 62... | |||
66 | local script name use_dhcp |
62 | local script name use_dhcp |
|
67 | |
63 | |