Ajouter automated_shutdown/shutdown-on-eth-fail.service
This commit is contained in:
13
automated_shutdown/shutdown-on-eth-fail.service
Normal file
13
automated_shutdown/shutdown-on-eth-fail.service
Normal 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
|
||||
Reference in New Issue
Block a user