12 lines
316 B
Bash
12 lines
316 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
sed -i 's/MODE=none/MODE=netserver/g' /etc/nut/nut.conf
|
||
|
echo "LISTEN 0.0.0.0 3493" >> /etc/nut/upsd.conf
|
||
|
echo -e "[$NAME] \n driver = $DRIVER \n port = $PORT \n pollfreq = $POLLFREQ \n desc = $DESC" >> /etc/nut/ups.conf
|
||
|
|
||
|
chgrp nut /etc/nut/*
|
||
|
chgrp nut /dev/bus/usb/*/*
|
||
|
|
||
|
upsdrvctl start
|
||
|
|
||
|
exec upsd -D
|