1
0
Fork 0
This commit is contained in:
Eros Nardi 2021-01-02 16:54:47 +01:00
commit ca8f7a7acd
3 changed files with 31 additions and 0 deletions

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM debian
ENV NAME myups
ENV DRIVER usbhid-ups
ENV PORT auto
ENV POLLFREQ 5
ENV DESC UPS
RUN apt-get update && apt-get -y install nut-server
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 3493

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# nut-docker
This Dockerfiles is tested to run on Raspberry Pi 4
Expects a UPS usb device passed to it with --device, find it with lsusb ex./dev/bus/usb/001/005

12
entrypoint.sh Normal file
View File

@ -0,0 +1,12 @@
#!/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