From ea4019a369d823cb8c2b688a4119deb1a9e46e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Fri, 3 Feb 2023 16:25:49 +0100 Subject: [PATCH] Test if status is different from "active" --- ur/fortinet.vpn.v6.sh | 2 +- ur/fortinet.vpn.v7.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ur/fortinet.vpn.v6.sh b/ur/fortinet.vpn.v6.sh index adb03e5..7dcb02d 100755 --- a/ur/fortinet.vpn.v6.sh +++ b/ur/fortinet.vpn.v6.sh @@ -251,7 +251,7 @@ main() { # {{{ debug_message "-- Connect VPN BEGIN" ### If forticlient-scheduler.service unit is not started {{{ systemd_forticlient_status=$(systemctl show --property ActiveState --value forticlient-scheduler.service || error_message "Error while requesting forticlient-scheduler.service unit status." 21) - if [ "${systemd_forticlient_status}" = "inactive" ] || [ "${systemd_forticlient_status}" = "failed" ]; then + if [ "${systemd_forticlient_status}" != "active" ]; then debug_message "| Try to start forticlient-scheduler.service unit." sudo systemctl restart forticlient-scheduler.service \ || error_message "Error while (re)starting forticlient-scheduler.service unit" 22 diff --git a/ur/fortinet.vpn.v7.sh b/ur/fortinet.vpn.v7.sh index 4d449de..df3840e 100755 --- a/ur/fortinet.vpn.v7.sh +++ b/ur/fortinet.vpn.v7.sh @@ -250,7 +250,7 @@ main() { # {{{ debug_message "-- Connect VPN BEGIN" ### If forticlient.service unit is not started {{{ systemd_forticlient_status=$(systemctl show --property ActiveState --value forticlient.service || error_message "Error while requesting forticlient.service unit status." 21) - if [ "${systemd_forticlient_status}" = "inactive" ]; then + if [ "${systemd_forticlient_status}" != "active" ]; then debug_message "| Try to start forticlient.service unit." sudo systemctl restart forticlient.service \ || error_message "Error while (re)starting forticlient.service unit" 22