dotfiles/dot_local/bin/executable_mullvad-status

15 lines
407 B
Text
Raw Normal View History

2022-07-30 07:17:12 +02:00
#!/usr/bin/env bash
while read LINE; do
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/')
ICON=" "
else
ICON=" "
fi
echo $ICON $OUTPUT
done < <(mullvad status listen)