Phase in ungleich-ups container
This commit is contained in:
parent
4ac8a0dec6
commit
f0ac9176cb
3 changed files with 36 additions and 0 deletions
19
ungleich-ups/Dockerfile_0.1.0
Normal file
19
ungleich-ups/Dockerfile_0.1.0
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
FROM alpine:3.24
|
||||
|
||||
RUN apk add -U
|
||||
|
||||
COPY virtlogd.conf /etc/libvirt/virtlogd.conf
|
||||
# Bug: https://gitlab.alpinelinux.org/alpine/aports/-/work_items/18437
|
||||
RUN ln -s /usr/lib/libusb-1.0.so.0.6.0 /usr/lib/libusb-1.0.so.0.5.0
|
||||
|
||||
# Allow a prometheus plugin to connect to it
|
||||
RUN sed -i 's/MODE=none/MODE=netserver/' /etc/nut/nut.conf
|
||||
|
||||
# Only listen on localhost, is good enough
|
||||
RUN echo LISTEN ::1 3493 >> /etc/nut/upsd.conf
|
||||
|
||||
# Prevent shutdown ?
|
||||
|
||||
COPY entrypoint.sh /
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
2
ungleich-ups/README.org
Normal file
2
ungleich-ups/README.org
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
* 0.1.0, 2026-09-10
|
||||
- Initial release
|
||||
15
ungleich-ups/entrypoint.sh
Executable file
15
ungleich-ups/entrypoint.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
# 2026-09-10, Nico Schottelius, Risch/Rotkreuz
|
||||
|
||||
# scan for ups & log to stdout
|
||||
nut-scanner -U 2>/dev/null | tee /etc/nut/ups.conf
|
||||
|
||||
/etc/init.d/nut-upsd start
|
||||
|
||||
while true; do
|
||||
ups_list=$(upsc -l 2>/dev/null)
|
||||
for ups in $ups_list; do
|
||||
upsc $ups
|
||||
done
|
||||
sleep 60
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue