bugfix: POE passthough fails on NS XM devices

the Nanostation XM devices require setting the gpio
port direction unlike some other devices
This commit is contained in:
Joe Ayers 2018-11-27 18:07:23 -08:00
parent a59fe2524a
commit 264c32a61d
1 changed files with 8 additions and 5 deletions

View File

@ -45,10 +45,13 @@ if [ -z "$pinnum" ]; then
echo "There are NO PoE Passthrough ports defined for this device" echo "There are NO PoE Passthrough ports defined for this device"
exit 1 exit 1
else else
export pin="gpio${pinnum}" export pin="gpio${pinnum}"
if [ ! -d "/sys/class/gpio/$pin" ]; then if [ ! -d "/sys/class/gpio/${pin}" ]; then
echo "${pinnum}" > /sys/class/gpio/export echo "${pinnum}" > /sys/class/gpio/export
fi fi
echo ${newval} > /sys/class/gpio/${pin}/value if [ -e "/sys/class/gpio/${pin}/direction" ]; then
echo "out" > /sys/class/gpio/${pin}/direction
fi
echo "${newval}" > /sys/class/gpio/${pin}/value
exit 0 exit 0
fi fi