]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
try alternate vpnc-script location (used by Debian-based distros)
authorDaniel Lenski <dlenski@gmail.com>
Wed, 21 Jun 2017 18:23:52 +0000 (11:23 -0700)
committerDavid Woodhouse <dwmw2@infradead.org>
Mon, 14 Aug 2017 16:30:15 +0000 (17:30 +0100)
This patch checks for the vpnc-script in the location used by
the standard vpnc-script package on Debian- and Ubuntu-based
Linux systems, /usr/share/vpnc-scripts/vpnc-script, in addition
to the standard /etc/vpnc/vpnc-script.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
configure.ac

index e11372836bd76d9f7bc4926e06d43953ecfc673e..0762b06c07e3f663ce983e43f270b3b9236f200a 100644 (file)
@@ -76,10 +76,15 @@ AC_ARG_WITH([vpnc-script],
          [default location of vpnc-script helper])])
 
 if test "$with_vpnc_script" = "yes" || test "$with_vpnc_script" = ""; then
+   AC_MSG_CHECKING([for vpnc-script in standard locations])
    if test "$have_win" = "yes"; then
       with_vpnc_script=vpnc-script-win.js
    else
-      with_vpnc_script=/etc/vpnc/vpnc-script
+      for with_vpnc_script in /usr/share/vpnc-scripts/vpnc-script /etc/vpnc/vpnc-script; do
+         if test -x "$with_vpnc_script"; then
+            break
+         fi
+      done
       if ! test -x "$with_vpnc_script"; then
         AC_MSG_ERROR([${with_vpnc_script} does not seem to be executable.]
  [OpenConnect will not function correctly without a vpnc-script.]
@@ -95,7 +100,9 @@ if test "$with_vpnc_script" = "yes" || test "$with_vpnc_script" = ""; then
  [build OpenConnect to use the script from this location, even though it is]
  [not present at the time you are building OpenConnect, pass the argument]
  ["--with-vpnc-script=${with_vpnc_script}"])
-     fi
+      else
+         AC_MSG_RESULT([${with_vpnc_script}])
+      fi
    fi
 elif test "$with_vpnc_script" = "no"; then
    AC_ERROR([You cannot disable vpnc-script.]