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

12 lines
305 B
Plaintext
Raw Normal View History

2019-07-18 16:45:46 +00:00
#!/usr/bin/env bash
OUTPUT=""
openvpn=$(pgrep -c openvpn$)
2021-01-30 17:48:18 +00:00
[ "$openvpn" -gt 0 ] && OUTPUT=$(eval printf "%.0s" "{1..$openvpn}")
2019-07-18 16:45:46 +00:00
openfortivpn=$(pgrep -c openfortivpn$)
[ "$openfortivpn" -gt 0 ] && OUTPUT=${OUTPUT}$(eval printf '%.0s' "{1..$openfortivpn}")
2019-07-18 16:45:46 +00:00
echo "$OUTPUT" | sed -e 's/\(.\)/\1 /g'