hnetd: add global config file
This commit is contained in:
parent
29bd0d47c2
commit
ddcdb773b3
3 changed files with 30 additions and 3 deletions
|
@ -7,8 +7,8 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hnetd
|
||||
PKG_SOURCE_VERSION:=c6da40c19d0e550cd1e2dd1a459ef6cab9b15cae
|
||||
PKG_VERSION:=2014-06-02-$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE_VERSION:=e60ce270f5a1ab01c6e262e1b9ee5cc20223b8c4
|
||||
PKG_VERSION:=2014-06-06-$(PKG_SOURCE_VERSION)
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
@ -65,6 +65,8 @@ define Package/hnetd/install
|
|||
ln -s hnetd $(1)/usr/sbin/hnet-call
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/hnetd.init $(1)/etc/init.d/hnetd
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DATA) ./files/hnet.config $(1)/etc/config/hnet
|
||||
$(INSTALL_BIN) ./files/ohp-script $(1)/usr/sbin/hnetd-ohp-script
|
||||
$(INSTALL_BIN) ./files/pcp-script $(1)/usr/sbin/hnetd-pcp-script
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/generic/hnetd-routing $(1)/usr/sbin/hnetd-routing
|
||||
|
|
8
hnetd/files/hnet.config
Normal file
8
hnetd/files/hnet.config
Normal file
|
@ -0,0 +1,8 @@
|
|||
config pa pa
|
||||
# option ip4prefix 10.0.0.0/8
|
||||
# option ulaprefix fd12:3456:789A::/48
|
||||
# option persistent_store /etc/hnet-pa.store
|
||||
|
||||
config sd sd
|
||||
# option router_name openwrt
|
||||
# option domain_name home.
|
|
@ -16,6 +16,10 @@ PCP_SCRIPT=/usr/sbin/hnetd-pcp-script
|
|||
PCP_BINARY=/usr/sbin/minimalist-pcproxy
|
||||
|
||||
start_service() {
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
config_load hnet
|
||||
|
||||
mkdir -p $DNSMASQ_DIR
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/hnetd
|
||||
|
@ -41,11 +45,24 @@ start_service() {
|
|||
fi
|
||||
|
||||
# State file
|
||||
procd_append_param command -s /tmp/hnetd.pa_state
|
||||
config_get val pa persistent_store
|
||||
procd_append_param command -s ${val:-/tmp/hnetd.pa_state}
|
||||
|
||||
# Routing script
|
||||
procd_append_param command -r /usr/sbin/hnetd-routing
|
||||
|
||||
config_get val pa ip4prefix
|
||||
[ -n "$val" ] && procd_append_param command --ip4prefix $val
|
||||
|
||||
config_get val pa ulaprefix
|
||||
[ -n "$val" ] && procd_append_param command --ulaprefix $val
|
||||
|
||||
config_get val sd router_name
|
||||
[ -n "$val" ] && procd_append_param command -n $val
|
||||
|
||||
config_get val sd domain_name
|
||||
[ -n "$val" ] && procd_append_param command -m $val
|
||||
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue