mirror of
https://github.com/Nardo86/nut-docker.git
synced 2025-02-16 11:40:50 +01:00
0
This commit is contained in:
commit
ca8f7a7acd
14
Dockerfile
Normal file
14
Dockerfile
Normal 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
5
README.md
Normal 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
12
entrypoint.sh
Normal 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
|
Loading…
x
Reference in New Issue
Block a user