[PATCH] try alternate vpnc-script location (used by Debian-based distros)

Daniel Lenski dlenski at gmail.com
Wed Jun 21 11:23:52 PDT 2017


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 at gmail.com>
---
 configure.ac | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5c50cf6..2643c63 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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.]
-- 
2.7.4




More information about the openconnect-devel mailing list