This commit is contained in:
2025-09-18 11:35:56 +02:00
commit 2203d6075f
45 changed files with 935 additions and 0 deletions

19
shell/toggle_wifi.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# Check if an interface name is provided
#if [ -z "$1" ]; then
# echo "Usage: $0 <interface_name>"
# exit 1
#fi
INTERFACE="wlo1"
# Parse the interface state from `ip a`
STATE=$(ip a show "$INTERFACE" 2>/dev/null | grep -oP '(?<=state )\w+')
# Check if the interface exists
if [ $STATE = "UP" ]; then
sudo ip link set $INTERFACE down
else
sudo ip link set $INTERFACE up
fi