diff --git a/ur/fortinet.vpn.sh b/ur/fortinet.vpn.sh index 137e817..f31d1b5 100755 --- a/ur/fortinet.vpn.sh +++ b/ur/fortinet.vpn.sh @@ -213,7 +213,7 @@ main() { # {{{ if [ "${request_status}" = "start" ]; then debug_message "-- Connect VPN BEGIN" ### If forticlient.service unit is not started {{{ - systemd_forticlient_status=$(systemctl show forticlient.service | grep "^ActiveStat" | sed 's/.*=\(.*\)/\1/' || error_message "Error while requesting forticlient.service unit status." 21) + systemd_forticlient_status=$(systemctl show --property ActiveState --value forticlient.service || error_message "Error while requesting forticlient.service unit status." 21) if [ "${systemd_forticlient_status}" = "failed" ]; then debug_message "| Try to start forticlient.service unit." sudo systemctl restart forticlient.service \ @@ -221,7 +221,7 @@ main() { # {{{ fi ### }}} ### If forticlient.service unit is started {{{ - systemd_forticlient_status=$(systemctl show forticlient.service | grep "^ActiveStat" | sed 's/.*=\(.*\)/\1/' || error_message "Error while requesting forticlient.service unit status." 21) + systemd_forticlient_status=$(systemctl show --property ActiveState --value forticlient.service || error_message "Error while requesting forticlient.service unit status." 21) if [ "${systemd_forticlient_status}" = "active" ]; then debug_message "| forticlient.service unit is ${RED}started${COLOR_DEBUG}." fi