Files
dots/config/polybar/scripts/vpn-openvpn-isrunning.sh
2025-11-24 19:46:30 +07:00

11 lines
322 B
Bash
Executable File

#!/bin/sh
#connection=$(pgrep -a openvpn$ | head -n 1 | awk '{print $NF }' | cut -d '.' -f 1)
connection=$(pgrep -a wg0 | head -n 1 | awk '{print $NF }' | cut -d '.' -f 1)
if [ -n "$connection" ]; then
echo "%{F#FFDE7D}%{T1}%{T-} %{T2}VPN: ON%{T-}"
else
echo "%{F#5f5f5f}%{T1}%{T-} %{T2}VPN: OFF%{T-}"
fi