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

@ -46,9 +46,12 @@ if [ -z "$pinnum" ]; then
exit 1
else
export pin="gpio${pinnum}"
if [ ! -d "/sys/class/gpio/$pin" ]; then
if [ ! -d "/sys/class/gpio/${pin}" ]; then
echo "${pinnum}" > /sys/class/gpio/export
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
fi