From a631f89729604f77a4907e5597bf15dd916f1e33 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 23 Aug 2016 10:37:23 +0200 Subject: [PATCH] package: add procd initscript and default uci config --- openwrt/freewtp/Makefile | 8 +- openwrt/freewtp/files/wtp.config | 8 + openwrt/freewtp/files/wtp.init | 278 +++++++++++++++++++++++++++++++ 3 files changed, 289 insertions(+), 5 deletions(-) create mode 100644 openwrt/freewtp/files/wtp.config create mode 100755 openwrt/freewtp/files/wtp.init diff --git a/openwrt/freewtp/Makefile b/openwrt/freewtp/Makefile index 4eb0a12..bb8ea0e 100644 --- a/openwrt/freewtp/Makefile +++ b/openwrt/freewtp/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=freewtp PKG_VERSION:=1.3.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/travelping/freewtp.git @@ -97,10 +97,8 @@ endef define Package/freewtp/install $(INSTALL_DIR) $(1)/etc/capwap - $(INSTALL_CONF) ./files/wtp.conf $(1)/etc/capwap/wtp.conf - $(INSTALL_CONF) ./files/ca.crt $(1)/etc/capwap/ca.crt - $(INSTALL_CONF) ./files/wtp.crt $(1)/etc/capwap/wtp.crt - $(INSTALL_CONF) ./files/wtp.key $(1)/etc/capwap/wtp.key + $(INSTALL_CONF) ./files/wtp.config $(1)/etc/config/wtp + $(INSTALL_BIN) ./files/wtp.init $(1)/etc/init.d/wtp $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wtp $(1)/usr/bin endef diff --git a/openwrt/freewtp/files/wtp.config b/openwrt/freewtp/files/wtp.config new file mode 100644 index 0000000..7f73336 --- /dev/null +++ b/openwrt/freewtp/files/wtp.config @@ -0,0 +1,8 @@ +config wtp + option country 'DE' + option location 'Magdeburg' + option name 'wtp-ap' + option ca '/etc/wtp/ca.crt' + option cert '/etc/wtp/wtp.crt' + option key '/etc/wtp/wtp.key' + diff --git a/openwrt/freewtp/files/wtp.init b/openwrt/freewtp/files/wtp.init new file mode 100755 index 0000000..c71a2ee --- /dev/null +++ b/openwrt/freewtp/files/wtp.init @@ -0,0 +1,278 @@ +#!/bin/sh /etc/rc.common + +START=80 + +USE_PROCD=1 +PROG=/usr/bin/wtp + + +wtp_conf_header() { + cat < /tmp/etc/wtp.conf +} + +start_service() { + config_load wtp + config_foreach wtp_uci_conf wtp + + procd_open_instance + procd_set_param command $PROG -c /tmp/etc/wtp.conf + procd_set_param respawn + procd_close_instance +}