瀏覽代碼

openconnect: use openconnect.upgrade to save configured files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Nikos Mavrogiannopoulos 10 年之前
父節點
當前提交
500db547b8
共有 3 個文件被更改,包括 11 次插入1 次删除
  1. 3
    1
      net/openconnect/Makefile
  2. 5
    0
      net/openconnect/files/openconnect.sh
  3. 3
    0
      net/openconnect/files/openconnect.upgrade

+ 3
- 1
net/openconnect/Makefile 查看文件

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=openconnect
11 11
 PKG_VERSION:=7.03
12
-PKG_RELEASE:=2
12
+PKG_RELEASE:=3
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/
@@ -69,6 +69,8 @@ define Package/openconnect/install
69 69
 	$(INSTALL_DIR) $(1)/usr/sbin
70 70
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/openconnect $(1)/usr/sbin/
71 71
 	$(INSTALL_BIN) ./files/openconnect-wrapper $(1)/usr/sbin/
72
+	$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
73
+	$(INSTALL_DATA) ./files/openconnect.upgrade $(1)/lib/upgrade/keep.d/openconnect
72 74
 endef
73 75
 
74 76
 $(eval $(call BuildPackage,openconnect))

+ 5
- 0
net/openconnect/files/openconnect.sh 查看文件

@@ -38,6 +38,11 @@ proto_openconnect_setup() {
38 38
 
39 39
 	cmdline="$server$port -i vpn-$config --non-inter --syslog --script /lib/netifd/vpnc-script"
40 40
 
41
+	# migrate to standard config files
42
+	[ -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"
43
+	[ -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"
44
+	[ -f "/etc/config/openconnect-ca-vpn-$config.pem" ] && mv "/etc/config/openconnect-ca-vpn-$config.pem" "/etc/openconnect/ca-vpn-$config.pem"
45
+
41 46
 	[ -f /etc/openconnect/user-cert-vpn-$config.pem ] && append cmdline "-c /etc/openconnect/user-cert-vpn-$config.pem"
42 47
 	[ -f /etc/openconnect/user-key-vpn-$config.pem ] && append cmdline "--sslkey /etc/openconnect/user-key-vpn-$config.pem"
43 48
 	[ -f /etc/openconnect/ca-vpn-$config.pem ] && {

+ 3
- 0
net/openconnect/files/openconnect.upgrade 查看文件

@@ -0,0 +1,3 @@
1
+/etc/openconnect/user-cert-vpn-*.pem
2
+/etc/openconnect/user-key-vpn-*.pem
3
+/etc/openconnect/ca-vpn-*.pem