ynh-vpnclient-checker.sh 258 B

123456789
  1. #!/bin/bash
  2. if [[ -e /tmp/.ynh-vpnclient-started ]] || ip route get 1.2.3.4 | grep -q tun0; then
  3. echo "[INFO] Service is already running"
  4. exit 0
  5. else
  6. echo "[INFO] Restarting VPN client service"
  7. yunohost service restart ynh-vpnclient &> /dev/null
  8. fi