openconnect: use openconnect.upgrade to save configured files
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 19 Jan 2015 21:46:12 +0000 (22:46 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 19 Jan 2015 22:15:57 +0000 (23:15 +0100)
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
net/openconnect/Makefile
net/openconnect/files/openconnect.sh
net/openconnect/files/openconnect.upgrade [new file with mode: 0644]

index 1cbeca7e3ca453cd9552dd15677b906d6ba2c542..1235f490ff95cf34a4b15c8bbfe4efe7e5f5cad2 100644 (file)
@@ -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))
index 553a4ed51ac4a82fdae4413f42bad8e8f6489543..cd97c2cb254de690facc0c0346be43c95b55f572 100755 (executable)
@@ -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 (file)
index 0000000..0e9192d
--- /dev/null
@@ -0,0 +1,3 @@
+/etc/openconnect/user-cert-vpn-*.pem
+/etc/openconnect/user-key-vpn-*.pem
+/etc/openconnect/ca-vpn-*.pem