Actualiser automated_shutdown/check_eth.sh

This commit is contained in:
2026-01-14 12:53:47 +00:00
parent 83d10090e6
commit 6ddc1183d0

View File

@@ -0,0 +1,17 @@
## nano /root/check_eth.sh && chmod +x /root/check_eth.sh
#!/bin/bash
INTERFACE="eth0"
TIMEOUT=300 # 5 minutes en secondes
if ! ifconfig $INTERFACE | grep -q "inet " ; then
echo "Ethernet down, checking for $((TIMEOUT/60)) minutes..."
sleep $TIMEOUT
if ! ifconfig $INTERFACE | grep -q "inet " ; then
echo "Ethernet still down, shutting down..."
shutdown -h now
fi
fi