From 500db547b82fbdc18355469b4572fded8fe040b6 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 19 Jan 2015 22:46:12 +0100 Subject: [PATCH] openconnect: use openconnect.upgrade to save configured files Signed-off-by: Nikos Mavrogiannopoulos --- net/openconnect/Makefile | 4 +++- net/openconnect/files/openconnect.sh | 5 +++++ net/openconnect/files/openconnect.upgrade | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 net/openconnect/files/openconnect.upgrade diff --git a/net/openconnect/Makefile b/net/openconnect/Makefile index 1cbeca7e3c..1235f490ff 100644 --- a/net/openconnect/Makefile +++ b/net/openconnect/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openconnect PKG_VERSION:=7.03 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/ @@ -69,6 +69,8 @@ define Package/openconnect/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/openconnect $(1)/usr/sbin/ $(INSTALL_BIN) ./files/openconnect-wrapper $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/lib/upgrade/keep.d + $(INSTALL_DATA) ./files/openconnect.upgrade $(1)/lib/upgrade/keep.d/openconnect endef $(eval $(call BuildPackage,openconnect)) diff --git a/net/openconnect/files/openconnect.sh b/net/openconnect/files/openconnect.sh index 553a4ed51a..cd97c2cb25 100755 --- a/net/openconnect/files/openconnect.sh +++ b/net/openconnect/files/openconnect.sh @@ -38,6 +38,11 @@ proto_openconnect_setup() { cmdline="$server$port -i vpn-$config --non-inter --syslog --script /lib/netifd/vpnc-script" + # migrate to standard config files + [ -f "/etc/config/openconnect-user-cert-vpn-$config.pem" ] && mv "/etc/config/openconnect-user-cert-vpn-$config.pem" "/etc/openconnect/user-cert-vpn-$config.pem" + [ -f "/etc/config/openconnect-user-key-vpn-$config.pem" ] && mv "/etc/config/openconnect-user-key-vpn-$config.pem" "/etc/openconnect/user-key-vpn-$config.pem" + [ -f "/etc/config/openconnect-ca-vpn-$config.pem" ] && mv "/etc/config/openconnect-ca-vpn-$config.pem" "/etc/openconnect/ca-vpn-$config.pem" + [ -f /etc/openconnect/user-cert-vpn-$config.pem ] && append cmdline "-c /etc/openconnect/user-cert-vpn-$config.pem" [ -f /etc/openconnect/user-key-vpn-$config.pem ] && append cmdline "--sslkey /etc/openconnect/user-key-vpn-$config.pem" [ -f /etc/openconnect/ca-vpn-$config.pem ] && { diff --git a/net/openconnect/files/openconnect.upgrade b/net/openconnect/files/openconnect.upgrade new file mode 100644 index 0000000000..0e9192d572 --- /dev/null +++ b/net/openconnect/files/openconnect.upgrade @@ -0,0 +1,3 @@ +/etc/openconnect/user-cert-vpn-*.pem +/etc/openconnect/user-key-vpn-*.pem +/etc/openconnect/ca-vpn-*.pem -- 2.30.2