diff --git a/net/openconnect/Makefile b/net/openconnect/Makefile index df0a70b7be..00fbf8b612 100644 --- a/net/openconnect/Makefile +++ b/net/openconnect/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openconnect PKG_VERSION:=6.00 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/ @@ -56,6 +56,7 @@ define Package/openconnect/install $(INSTALL_BIN) ./files/vpnc-script $(1)/lib/netifd/ $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/openconnect $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/openconnect-wrapper $(1)/usr/sbin/ endef $(eval $(call BuildPackage,openconnect)) diff --git a/net/openconnect/files/openconnect-wrapper b/net/openconnect/files/openconnect-wrapper new file mode 100755 index 0000000000..eb2df54f4f --- /dev/null +++ b/net/openconnect/files/openconnect-wrapper @@ -0,0 +1,14 @@ +#!/bin/sh + +# This script wraps openconnect in order to obtain the password +# file from cmd. + +# $1 password file +# $2... are passed to openconnect + +test -z "$1" && exit 1 + +pwfile=$1 +shift + +cat $pwfile|/usr/sbin/openconnect $* diff --git a/net/openconnect/files/openconnect.sh b/net/openconnect/files/openconnect.sh index 315b311efa..404ed6b6db 100755 --- a/net/openconnect/files/openconnect.sh +++ b/net/openconnect/files/openconnect.sh @@ -55,13 +55,15 @@ proto_openconnect_setup() { logger -t openconnect "executing 'openconnect $cmdline'" if [ -f "$pwfile" ];then - proto_run_command "$config" /usr/sbin/openconnect $cmdline <$pwfile + proto_run_command "$config" /usr/sbin/openconnect-wrapper $pwfile $cmdline else proto_run_command "$config" /usr/sbin/openconnect $cmdline fi } proto_openconnect_teardown() { + local config="$1" + pwfile="/var/run/openconnect-$config.passwd" rm -f $pwfile