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