dotfiles/_desktop/_scripts/sb-network

9 lines
308 B
Plaintext
Raw Normal View History

2023-02-09 01:23:49 +01:00
#!/bin/bash
2023-03-30 00:17:01 +02:00
ip a | grep -q wg0 && wg_status="wireguard running " || wg_status=""
case "$(cat /sys/class/net/wlan0/operstate 2>/dev/null)" in
down) printf "${wg_status} no wifi" ;;
2023-02-09 01:23:49 +01:00
up)
2023-03-30 00:17:01 +02:00
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] && printf "${wg_status}"|| printf "${wg_status}no ip" ;;
2023-02-09 01:23:49 +01:00
esac