Browse Source

ocserv: use ocserv.upgrade to save configured files

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
lilik-openwrt-22.03
Nikos Mavrogiannopoulos 10 years ago
parent
commit
1a67e62e7e
3 changed files with 16 additions and 1 deletions
  1. +3
    -1
      net/ocserv/Makefile
  2. +6
    -0
      net/ocserv/files/ocserv.init
  3. +7
    -0
      net/ocserv/files/ocserv.upgrade

+ 3
- 1
net/ocserv/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ocserv
PKG_VERSION:=0.8.9
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
@ -87,6 +87,8 @@ define Package/ocserv/install
$(INSTALL_CONF) ./files/ocserv.conf.template $(1)/etc/ocserv/ocserv.conf.template
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/config $(1)/etc/config/ocserv
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_DATA) ./files/ocserv.upgrade $(1)/lib/upgrade/keep.d/ocserv
endef
$(eval $(call BuildPackage,ocserv))

+ 6
- 0
net/ocserv/files/ocserv.init View File

@ -99,6 +99,12 @@ start() {
hostname=`uci show ddns|grep domain|head -1|cut -d '=' -f 2 2>/dev/null`
[ -z "$hostname" ] && hostname=`uci get system.@system[0].hostname 2>/dev/null`
[ -f /etc/config/ocserv-dir/ca-key.pem ] && mv /etc/config/ocserv-dir/ca-key.pem /etc/ocserv/ca-key.pem
[ -f /etc/config/ocserv-dir/ca.pem ] && mv /etc/config/ocserv-dir/ca.pem /etc/ocserv/ca.pem
[ -f /etc/config/ocserv-dir/server-key.pem ] && mv /etc/config/ocserv-dir/server-key.pem /etc/ocserv/server-key.pem
[ -f /etc/config/ocserv-dir/server-cert.pem ] && mv /etc/config/ocserv-dir/server-cert.pem /etc/ocserv/server-cert.pem
[ -d /etc/config/ocserv-dir ] && rmdir /etc/config/ocserv-dir
[ ! -f /etc/ocserv/ca-key.pem ] && [ -x /usr/bin/certtool ] && {
logger -t ocserv "Generating CA certificate..."
mkdir -p /etc/ocserv/pki/


+ 7
- 0
net/ocserv/files/ocserv.upgrade View File

@ -0,0 +1,7 @@
/etc/ocserv/ca-key.pem
/etc/ocserv/ca.pem
/etc/ocserv/server-key.pem
/etc/ocserv/server-cert.pem
/etc/ocserv/config-per-user/*
/etc/ocserv/config-per-group/*
/etc/ocserv/crl.pem

Loading…
Cancel
Save