Improves safe-*

This commit is contained in:
2026-05-23 12:46:29 +02:00
parent 9929a7055b
commit a8beecdbd5
4 changed files with 16 additions and 15 deletions
+1 -7
View File
@@ -1,11 +1,5 @@
#!/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
/opt/bin/safe-stop
systemctl reboot