Browse Source

openconnect: use openconnect.upgrade to save configured files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
lilik-openwrt-22.03
Nikos Mavrogiannopoulos 10 years ago
parent
commit
500db547b8
3 changed files with 11 additions and 1 deletions
  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 View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=openconnect PKG_NAME:=openconnect
PKG_VERSION:=7.03 PKG_VERSION:=7.03
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/ PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/
@ -69,6 +69,8 @@ define Package/openconnect/install
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/openconnect $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/openconnect $(1)/usr/sbin/
$(INSTALL_BIN) ./files/openconnect-wrapper $(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 endef
$(eval $(call BuildPackage,openconnect)) $(eval $(call BuildPackage,openconnect))

+ 5
- 0
net/openconnect/files/openconnect.sh View File

@ -38,6 +38,11 @@ proto_openconnect_setup() {
cmdline="$server$port -i vpn-$config --non-inter --syslog --script /lib/netifd/vpnc-script" 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-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/user-key-vpn-$config.pem ] && append cmdline "--sslkey /etc/openconnect/user-key-vpn-$config.pem"
[ -f /etc/openconnect/ca-vpn-$config.pem ] && { [ -f /etc/openconnect/ca-vpn-$config.pem ] && {


+ 3
- 0
net/openconnect/files/openconnect.upgrade View File

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

Loading…
Cancel
Save