[OpenWrt-Devel] [PATCH 1/1] use NTP server received via DHCP

Bastian Bittorf bittorf at bluebottle.com
Tue Jan 12 04:13:59 EST 2016


* amine ahd <amine.ahd at gmail.com> [12.01.2016 10:08]:
> +	[ "$use_dhcp" = 1 ] && {
> +		if [ -z "$dhcp_ifaces" ]; then
> +			local dump=$(ubus call network.interface dump)
> +			ntpservers=$(jsonfilter -s "$dump" -e '$["interface"][*]["data"]["ntpserver"]')

please make 'ntpservers' once local in the function head

> +		else
> +			for iface in $dhcp_ifaces; do
> +				local status=$(ubus call network.interface.$iface status)
> +				local ntpserver=$(jsonfilter -s "$status" -e '$["data"]["ntpserver"]')
> +				[ -n "$ntpserver" ] && \\

this is one '\' to much

> +is_valid_interface() {
> +	local list=$(uci get system.ntp.dhcp_ifaces)

just for me: use list="$( ... )"

bye,bastian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list