ups: include Innova...

This commit is contained in:
Nico Schottelius 2024-08-17 18:12:56 +02:00
parent e0f6cfe931
commit c090894009

6
openwrt/openwrt-configure-nut-ups.sh Normal file → Executable file
View file

@ -3,7 +3,7 @@
# create configuration for nut based on available usb ups # create configuration for nut based on available usb ups
if [ $# -lt 8 ] ; then if [ $# -lt 1 ] ; then
echo $0 "address" echo $0 "address"
exit 1 exit 1
fi fi
@ -12,11 +12,9 @@ address=$1; shift
cat <<EOF | ssh -t "root@${address}" cat <<EOF | ssh -t "root@${address}"
set -x set -x
opkg update
i=1 i=1
for ups in \$(lsusb -vv 2>/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}=driver
uci set nut_server.ups\${i}.port=auto uci set nut_server.ups\${i}.port=auto