mirror of https://github.com/aredn/aredn.git
bugfix: correct initial values for poe and usb passthrough (#271)
* bugfix: correct initial values for poe and usb passthrough * correct a few shellcheck errors
This commit is contained in:
parent
a997ef9545
commit
854afdb32d
|
@ -51,9 +51,26 @@ boot() {
|
||||||
[ -x /etc/local/services ] && /etc/local/services
|
[ -x /etc/local/services ] && /etc/local/services
|
||||||
|
|
||||||
# set POE passthrough if available
|
# set POE passthrough if available
|
||||||
local poevalue=$(uci get aredn.@poe[0].passthrough)
|
local poevalue=$(uci -q get aredn.@poe[0].passthrough)
|
||||||
if [ -z $poevalue]; then
|
if [ -z "$poevalue" ]; then
|
||||||
poevalue=0
|
local dpval=$(jsonfilter -e '@.gpioswitch.poe_passthrough.default' < /etc/board.json)
|
||||||
|
if [ ! -z "$dpval" ]; then
|
||||||
|
uci -q add aredn poe
|
||||||
|
uci -q set aredn.@poe[0].passthrough="$dpval"
|
||||||
|
uci -q commit aredn
|
||||||
|
poevalue=$dpval
|
||||||
fi
|
fi
|
||||||
/usr/local/bin/poe_passthrough ${poevalue}
|
fi
|
||||||
|
/usr/local/bin/poe_passthrough "${poevalue}"
|
||||||
|
|
||||||
|
# set USB passthrough if available
|
||||||
|
local usbvalue=$(uci -q get aredn.@usb[0].passthrough)
|
||||||
|
if [ -z "$usbvalue" ]; then
|
||||||
|
local duval=$(jsonfilter -e '@.gpioswitch.usb_power_switch.default' < /etc/board.json)
|
||||||
|
uci -q add aredn usb
|
||||||
|
uci -q set aredn.@usb[0].passthrough="$duval"
|
||||||
|
uci -q commit aredn
|
||||||
|
usbvalue=$duval
|
||||||
|
fi
|
||||||
|
/usr/local/bin/poe_passthrough "${usbvalue}"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue