home/config/polybar/scripts/vpn-openvpn-isrunning.sh

10 lines
162 B
Bash
Raw Normal View History

2020-11-17 13:58:04 +01:00
#!/bin/sh
connection=$(pgrep -a openvpn$ | head -n 1 | awk '{print $NF }' | cut -d '.' -f 1)
if [ -n "$connection" ]; then
echo "On"
else
echo "Off"
fi