1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-12-23 14:56:48 +00:00
dotfiles/.config/polybar/scripts/check_vpn

12 lines
304 B
Bash
Executable File

#!/usr/bin/env bash
OUTPUT=""
openvpn=$(pgrep -c openvpn$)
[ "$openvpn" -gt 0 ] && OUTPUT=$(eval printf "%.0s" "{1..$openvpn}")
globalprotect=$(pgrep -c gpclient$)
[ "$globalprotect" -gt 0 ] && OUTPUT=${OUTPUT}$(eval printf '%.0s' "{1..$globalprotect}")
echo "$OUTPUT" | sed -e 's/\(.\)/\1 /g'