diff --git a/files/usr/local/bin/node-setup b/files/usr/local/bin/node-setup index 4dbe7301..562269a6 100755 --- a/files/usr/local/bin/node-setup +++ b/files/usr/local/bin/node-setup @@ -138,7 +138,9 @@ local changes = { tunnels = false, wireless = false, localservices = false, - wpad = false + wpad = false, + poe = false, + pou = false } function valid_config(config) @@ -1296,7 +1298,9 @@ local config_special = { wifi_mode_0 = c:get("wireless", "@wifi-iface[0]", "mode"), wifi_mode_1 = c:get("wireless", "@wifi-iface[1]", "mode"), wifi_channel_0 = c:get("wireless", "@wifi-device[0]", "channel"), - wifi_channel_1 = c:get("wireless", "@wifi-device[1]", "channel") + wifi_channel_1 = c:get("wireless", "@wifi-device[1]", "channel"), + power_eth = c:get("aredn", "@poe[0]", "passthrough"), + power_usb = c:get("aredn", "@usb[0]", "passthrough") } local nfiles = {} for file in nixio.fs.glob("/tmp/new_config/*") @@ -1345,6 +1349,12 @@ do if oc:get("aredn", "@wan[0]", "web_access") ~= config_special.web_access or oc:get("aredn", "@wan[0]", "ssh_access") ~= config_special.ssh_access or oc:get("aredn", "@wan[0]", "telnet_access") ~= config_special.telnet_access then changes.firewall = true end + if oc:get("aredn", "@poe[0]", "passthrough") ~= config_special.power_eth then + change.poe = true; + end + if oc:get("aredn", "@usb[0]", "passthrough") ~= config_special.power_usb then + change.pou = true; + end elseif file == "network" then changes.network = true changes.tunnels = true -- restarting network devices requires tunnels to restart diff --git a/files/usr/local/bin/restart-services.sh b/files/usr/local/bin/restart-services.sh index a53b18f1..88ce4649 100755 --- a/files/usr/local/bin/restart-services.sh +++ b/files/usr/local/bin/restart-services.sh @@ -74,6 +74,10 @@ do /sbin/wifi reload > /dev/null 2>&1 elif [ $srv = "localservices" ]; then /etc/local/services > /dev/null 2>&1 + elif [ $srv = "poe" ]; then + /usr/local/bin/poe_passthrough $(/sbin/uci -q get aredn.@poe[0].passthrough) > /dev/null 2>&1 + elif [ $srv = "pou" ]; then + /usr/local/bin/usb_passthrough $(/sbin/uci -q get aredn.@usb[0].passthrough) > /dev/null 2>&1 elif [ -x /etc/init.d/$srv ]; then /etc/init.d/$srv restart > /dev/null 2>&1 fi