i3vpn.sh 523 B

123456789101112131415161718
  1. #!/bin/sh
  2. status=$(pvpn --status)
  3. public_ip=$(pvpn --status | awk -F: '/Public/ {print $2}')
  4. conn_status=$(pvpn --status | awk -F: '/ProtonVPN Status/ {print $2}')
  5. #server=$(pvpn --status | awk -F: '/Server Name/ {print $2}')
  6. if [ "$conn_status" = " Not Running" ] ; then
  7. connected="<span color='#586E75'>{not connected}</span>"
  8. elif [ "$conn_status" = " Running" ] ; then
  9. connected="<span color='#19c682'>{connected}</span> [$public_ip ]"
  10. else
  11. connected="~"
  12. fi
  13. #printf "$connected\n"
  14. printf "$connected\n"