Files
csr_setup/lib/lan.sh
lucas_csr 20781c9d90 ordered into /lib
put all subscripts into lib for readability
2026-07-14 16:56:28 +02:00

27 lines
569 B
Bash

#!/bin/bash
function LAN_CABLE(){
for iface in /sys/class/net/*; do
iface_name=$(basename "$iface")
if [[ "$iface_name" == "lo" ]]; then
continue
fi
if [[ "${iface_name:0:2}" == "wl" ]]; then
continue
fi
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
}