init
This commit is contained in:
29
lan.sh
Normal file
29
lan.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
for iface in /sys/class/net/*; do
|
||||
iface_name=$(basename "$iface")
|
||||
#echo "${iface_name:0:2}"
|
||||
|
||||
# Skip loopback
|
||||
if [[ "$iface_name" == "lo" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ "${iface_name:0:2}" == "wl" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# Check if carrier file exists (only for physical interfaces)
|
||||
if [[ -f "$iface/carrier" ]]; then
|
||||
carrier=$(cat "$iface/carrier")
|
||||
|
||||
if [[ "$carrier" == "1" ]]; then
|
||||
echo "Bitte LAN Kabel entfernen"
|
||||
read -n 1 -s -r -p "Any key to continue"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "LAN cable is NOT connected"
|
||||
return 1
|
||||
Reference in New Issue
Block a user