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
+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