diff --git a/openwrt/openwrt-configure-nut-ups.sh b/openwrt/openwrt-configure-nut-ups.sh old mode 100644 new mode 100755 index d87e478..1c793dc --- a/openwrt/openwrt-configure-nut-ups.sh +++ b/openwrt/openwrt-configure-nut-ups.sh @@ -3,7 +3,7 @@ # create configuration for nut based on available usb ups -if [ $# -lt 8 ] ; then +if [ $# -lt 1 ] ; then echo $0 "address" exit 1 fi @@ -12,11 +12,9 @@ address=$1; shift cat </dev/null | grep -e "iProduct.* UPS" -A1 | awk '/iSerial/ { print \$3 }'); do +for ups in \$(lsusb -vv 2>/dev/null | grep -e "iProduct.* UPS" -e "iProduct.*Innova Unity" -A1 | awk '/iSerial/ { print \$3 }'); do uci set nut_server.ups\${i}=driver uci set nut_server.ups\${i}.port=auto