Ajouter automated_shutdown/shutdown-on-eth-fail.service

This commit is contained in:
2026-01-14 12:59:37 +00:00
parent f29b4dc7bc
commit 048868a115

View File

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