This commit is contained in:
commit
ca8f7a7acd
|
@ -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
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue