Adds safe-reboot and safe-shutdown, removes all .sh extensions to scripts

This commit is contained in:
2026-05-21 21:09:34 +02:00
parent f806bda21b
commit 9929a7055b
38 changed files with 91 additions and 44 deletions
+1 -1
View File
@@ -3,4 +3,4 @@ Description=Copies the music from Nextcloud to Navidrome
[Service]
Type=oneshot
ExecStart=/root/scripts/copy-music.sh
ExecStart=/root/scripts/copy-music
+1 -1
View File
@@ -3,4 +3,4 @@ Description=Move the completed torrents and jdownloader downloads to nextcloud
[Service]
Type=oneshot
ExecStart=/root/scripts/move-downloads-nextcloud.sh
ExecStart=/root/scripts/move-downloads-nextcloud
+1 -1
View File
@@ -1 +1 @@
homeassistant ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown
homeassistant ALL=(ALL) NOPASSWD: /opt/bin/safe-reboot, /opt/bin/safe-shutdown
+1 -1
View File
@@ -3,4 +3,4 @@ Description=Runs rclone to copy the NAS content to the parents NAS
[Service]
Type=oneshot
ExecStart=/usr/bin/flock -n /run/rclone-parents.lock /root/scripts/rclone-parents.sh
ExecStart=/usr/bin/flock -n /run/rclone-parents.lock /root/scripts/rclone-parents
+4
View File
@@ -0,0 +1,4 @@
[Journal]
SystemMaxUse=256M # Maximum total journal size
RuntimeMaxUse=128M # Maximum journal size in temporary storage
MaxFileSec=1month # Maximum time to retain log files
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
set -o errexit -o pipefail -o noclobber -o nounset -o errtrace -o functrace
users=(arr gitea homeassistant immich jdownloader kiwix komga navidrome nextcloud nginx pairdrop paperless pihole qbittorrent synapse wallabag)
for user in "${users[@]}"; do
readarray -t units <<< "$(systemctl --user -M "${user}@" list-units | grep container | grep running | grep service | awk '{print $1}')" || true
if [[ "${#units[@]}" -gt 0 && -n "${units[0]:-}" ]]; then
systemctl --user -M "${user}@" stop "${units[@]}"
fi
done
systemctl reboot
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
set -o errexit -o pipefail -o noclobber -o nounset -o errtrace -o functrace
users=(arr gitea homeassistant immich jdownloader kiwix komga navidrome nextcloud nginx pairdrop paperless pihole qbittorrent synapse wallabag)
for user in "${users[@]}"; do
readarray -t units <<< "$(systemctl --user -M "${user}@" list-units | grep container | grep running | grep service | awk '{print $1}')" || true
if [[ "${#units[@]}" -gt 0 && -n "${units[0]:-}" ]]; then
systemctl --user -M "${user}@" stop "${units[@]}"
fi
done
systemctl poweroff