From 048868a11502e2553c9a0363da0467ada5c68971 Mon Sep 17 00:00:00 2001 From: xavye Date: Wed, 14 Jan 2026 12:59:37 +0000 Subject: [PATCH] Ajouter automated_shutdown/shutdown-on-eth-fail.service --- automated_shutdown/shutdown-on-eth-fail.service | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 automated_shutdown/shutdown-on-eth-fail.service diff --git a/automated_shutdown/shutdown-on-eth-fail.service b/automated_shutdown/shutdown-on-eth-fail.service new file mode 100644 index 0000000..0856a3a --- /dev/null +++ b/automated_shutdown/shutdown-on-eth-fail.service @@ -0,0 +1,13 @@ +/etc/systemd/system/shutdown-on-eth-fail.service + + +[Unit] +Description=Shutdown on Ethernet Failure +After=eth-monitor.service + +[Service] +Type=oneshot +ExecStart=/bin/sh -c 'if [ $(journalctl -u eth-monitor.service --since "5 minutes ago" | grep -c "is down") -ge 5 ]; then /sbin/shutdown -h now; fi' + +[Install] +WantedBy=multi-user.target \ No newline at end of file