Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
Jeroen Oudshoorn
2023-10-17 17:06:05 +02:00
parent a09415df67
commit 92a6278317
4 changed files with 61 additions and 10 deletions

View File

@ -2,6 +2,7 @@
# well ... it blinks the led
blink_led() {
# shellcheck disable=SC2034
for i in $(seq 1 "$1"); do
echo 0 >/sys/class/leds/led0/brightness
sleep 0.3
@ -55,7 +56,7 @@ stop_monitor_interface() {
# returns 0 if the specificed network interface is up
is_interface_up() {
if grep -qi 'up' /sys/class/net/$1/operstate; then
if grep -qi 'up' /sys/class/net/"$1"/operstate; then
return 0
fi
return 1
@ -79,7 +80,7 @@ is_auto_mode() {
# if usb0 is up, we're in MANU
if is_interface_up usb0; then
return 1
return 0
fi
# if eth0 is up (for other boards), we're in MANU
@ -105,7 +106,7 @@ is_auto_mode_no_delete() {
# if usb0 is up, we're in MANU
if is_interface_up usb0; then
return 1
return 0
fi
# if eth0 is up (for other boards), we're in MANU