samm-git / jvpn

Perl script to connect to the Juniper VPN with Host Checker enabled

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tell user how NCSVC failed when status returned is "6e", if possible

benhuxley2 opened this issue · comments

    Show ncsvc error message when communication with daemon fails.

diff --git a/jvpn.pl b/jvpn.pl
index 947ebc4..1cef4f1 100755
--- a/jvpn.pl
+++ b/jvpn.pl
@@ -452,7 +452,8 @@ if($mode eq "ncsvc") {
        # exit on any other values
        
        if($status ne "6d") {
-               printf("Status=$status\nAuthentication failed, exiting\n");
+               printf("Status=$status\nError via IPC from ncsvc, exiting\n");
+               system("grep -B2 disconnecting ~/.juniper_networks/network_connect/ncsvc.log | tail -n 3");
                system("./ncsvc -K");
                exit(1);
        }