@@ -148,6 +148,8 @@ case "$action" in
# ########## #
start)
+ info "[vpnclient] Starting..."
+
if [[ -e /tmp/.ynh-vpnclient.started ]] || systemctl -q is-active openvpn@client.service; then
info "Service is already running"
exit 0
@@ -1,7 +1,9 @@
#!/bin/bash
-if [[ ! -e /tmp/.ynh-vpnclient-started ]] && ! ip route get 1.2.3.4 | grep -q tun0; then
- systemctl restart ynh-vpnclient &> /dev/null
+if [[ -e /tmp/.ynh-vpnclient-started ]] || ip route get 1.2.3.4 | grep -q tun0; then
+ echo "[INFO] Service is already running"
+ exit 0
+else
+ echo "[INFO] Restarting VPN client service"
+ yunohost service restart ynh-vpnclient &> /dev/null
fi
-
-exit 0