[status] fix: openvpn status check

This commit is contained in:
David JULIEN 2023-01-19 19:17:02 +01:00
parent c43b07af1a
commit 553556143f

View File

@ -22,7 +22,7 @@ eth="$(cat /sys/class/net/enp0s31f6/operstate &> /dev/null)"
if [ "up" = "$eth" ]; then
str="$(printf "%s / " "$str")"
fi
vpn="$(pidof openvpn)"
[ -n "$vpn" ] && str="$(printf "%s " "$str")"
vpn="$(ip route | head -n1 | rev | cut -d' ' -f2 | rev)"
[ "tun0" = "$vpn" -o "tap0" = "$vpn" ] && str="$(printf "%s " "$str")"
printf " %s " "$str"