Skip to content

Commit

Permalink
⬆️ Upgrades add-on base image to 6.0.0 (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Jun 10, 2022
1 parent 05be885 commit a5e9aff
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 25 deletions.
2 changes: 1 addition & 1 deletion nut/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base/amd64:5.3.0
ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base/amd64:6.0.0
# hadolint ignore=DL3006
FROM ${BUILD_FROM}

Expand Down
10 changes: 5 additions & 5 deletions nut/build.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
build_from:
aarch64: ghcr.io/hassio-addons/debian-base/aarch64:5.3.0
amd64: ghcr.io/hassio-addons/debian-base/amd64:5.3.0
armhf: ghcr.io/hassio-addons/debian-base/armhf:5.3.0
armv7: ghcr.io/hassio-addons/debian-base/armv7:5.3.0
i386: ghcr.io/hassio-addons/debian-base/i386:5.3.0
aarch64: ghcr.io/hassio-addons/debian-base/aarch64:6.0.0
amd64: ghcr.io/hassio-addons/debian-base/amd64:6.0.0
armhf: ghcr.io/hassio-addons/debian-base/armhf:6.0.0
armv7: ghcr.io/hassio-addons/debian-base/armv7:6.0.0
i386: ghcr.io/hassio-addons/debian-base/i386:6.0.0
codenotary:
base_image: codenotary@frenck.dev
signer: codenotary@frenck.dev
1 change: 1 addition & 0 deletions nut/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ arch:
- armhf
- armv7
- i386
init: false
uart: true
udev: true
usb: true
Expand Down
9 changes: 8 additions & 1 deletion nut/rootfs/etc/cont-init.d/nut.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bashio
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Network UPS Tools
# Configures Network UPS Tools
Expand All @@ -11,6 +11,13 @@ declare shutdowncmd
declare upsmonpwd
declare username

chown root:root /var/run/nut
chmod 0770 /var/run/nut

chown -R root:root /etc/nut
find /etc/nut -not -perm 0660 -type f -exec chmod 0660 {} \;
find /etc/nut -not -perm 0660 -type d -exec chmod 0660 {} \;

nutmode=$(bashio::config 'mode')
bashio::log.info "Setting mode to ${nutmode}..."
sed -i "s#%%nutmode%%#${nutmode}#g" /etc/nut/nut.conf
Expand Down
2 changes: 1 addition & 1 deletion nut/rootfs/etc/cont-init.d/nutclient.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bashio
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Network UPS Tools
# Configures Network UPS Tools for Client Mode only
Expand Down
5 changes: 0 additions & 5 deletions nut/rootfs/etc/fix-attrs.d/nut

This file was deleted.

10 changes: 6 additions & 4 deletions nut/rootfs/etc/services.d/upsd/finish
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/execlineb -S0
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Network UPS Tools
# Take down the S6 supervision tree when upsd fails
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
bashio::log.warning "upsd crashed, halting add-on"
/run/s6/basedir/bin/halt
fi

s6-svscanctl -t /var/run/s6/services
bashio::log.info "upsd stopped, restarting..."
2 changes: 1 addition & 1 deletion nut/rootfs/etc/services.d/upsd/run
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bashio
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Network UPS Tools
# Run upsd
Expand Down
12 changes: 7 additions & 5 deletions nut/rootfs/etc/services.d/upsmon/finish
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/execlineb -S0
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Network UPS Tools
# Take down the S6 supervision tree when upsd fails
# Take down the S6 supervision tree when upsmon fails
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
bashio::log.warning "upsmon crashed, halting add-on"
/run/s6/basedir/bin/halt
fi

s6-svscanctl -t /var/run/s6/services
bashio::log.info "upsmon stopped, restarting..."
2 changes: 1 addition & 1 deletion nut/rootfs/etc/services.d/upsmon/run
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bashio
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Network UPS Tools
# Run upsmon
Expand Down
Empty file modified nut/rootfs/usr/bin/notify
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion nut/rootfs/usr/bin/shutdownhost
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bashio
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Network UPS Tools
# Script to shutdown the host from UPS Shutdown Command
Expand Down
Empty file modified nut/rootfs/usr/bin/wall
100644 → 100755
Empty file.

0 comments on commit a5e9aff

Please sign in to comment.