Adds safe-reboot and safe-shutdown, removes all .sh extensions to scripts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
@@ -1 +1 @@
|
||||
homeassistant ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown
|
||||
homeassistant ALL=(ALL) NOPASSWD: /opt/bin/safe-reboot, /opt/bin/safe-shutdown
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user