dotfiles/de/home/.config/eww/scripts/bar/vpn-status
2025-03-05 21:00:06 -08:00

16 lines
318 B
Bash
Executable file

#!/bin/bash
nm_active=`nmcli con show --active`
vpn_active='false'
if [ -z ${1} ];then
if echo "${nm_active}" | grep -q 'vpn' || echo "${nm_active}" | grep -q 'wireguard';then
vpn_active='true'
fi
else
if echo "${nm_active}" | grep -q "${1}";then
vpn_active='true'
fi
fi
printf '%s' "${vpn_active}"