dotfiles/dot_local/bin/executable_mullvad-status

15 lines
416 B
Text
Raw Normal View History

2022-07-30 07:17:12 +02:00
#!/usr/bin/env bash
while read -r LINE; do
2022-07-30 07:17:12 +02:00
if echo "$LINE" | grep -q 'Connected'; then
# get the relay (3rd word) | drop the wireguard/openvpn suffix | make it uppercase
# just replace this with whatever style you like
OUTPUT=$(echo "$LINE" | cut -d " " -f 3 | cut -d "-" -f 1 | tr '/a-z/' '/A-Z/')
2022-07-30 07:17:12 +02:00
ICON=" "
else
ICON=" "
fi
echo "$ICON" "$OUTPUT"
2022-07-30 07:17:12 +02:00
done < <(mullvad status listen)