vpn-endpoint.j2 312 B

12345678910111213
  1. #!/bin/bash
  2. istatus=$(systemctl is-active {{ openvpn_service }})
  3. endpoint={{ nord_cn }}
  4. format="%-28s \x1b[32m%s\x1b[0m\n" # green output by default
  5. if [ "$istatus" != "active" ]; then
  6. format="%-28s \x1b[31m%s\x1b[0m\n" # make red if service not active
  7. fi
  8. printf "$format" "OpenVPN Endpoint:" "$endpoint"