diff --git a/package/gluon-radvd/Makefile b/package/gluon-radvd/Makefile index 6421b4a5..2b99c283 100644 --- a/package/gluon-radvd/Makefile +++ b/package/gluon-radvd/Makefile @@ -1,8 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gluon-radvd -PKG_VERSION:=1 -PKG_RELEASE:=1.$(GLUON_CONFIG_VERSION) +PKG_VERSION:=2 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) @@ -31,7 +30,6 @@ endef define Package/gluon-radvd/install $(CP) ./files/* $(1)/ - $(GLUON_GENERATE) ./generate/* $(1)/ endef $(eval $(call BuildPackage,gluon-radvd)) diff --git a/package/gluon-radvd/files/etc/init.d/gluon-radvd b/package/gluon-radvd/files/etc/init.d/gluon-radvd index 2cfe0980..83814d50 100755 --- a/package/gluon-radvd/files/etc/init.d/gluon-radvd +++ b/package/gluon-radvd/files/etc/init.d/gluon-radvd @@ -7,12 +7,19 @@ SERVICE_NAME=gluon-radvd SERVICE_PID_DIR=/var/run/gluon-radvd SERVICE_PID_FILE="$SERVICE_PID_DIR"/gluon-radvd.pid +radvd_conf=/var/gluon/radvd/radvd.conf + start() { mkdir -p "$SERVICE_PID_DIR" chown gluon-radvd "$SERVICE_PID_DIR" - service_start /usr/sbin/radvd -C /lib/gluon/radvd/radvd.conf -m stderr_syslog -u gluon-radvd -p "$SERVICE_PID_FILE" + + mkdir -p "$(dirname "$radvd_conf")" + /lib/gluon/radvd/generate_config > "$radvd_conf" + + service_start /usr/sbin/radvd -C "$radvd_conf" -m stderr_syslog -u gluon-radvd -p "$SERVICE_PID_FILE" } stop() { service_stop /usr/sbin/radvd + rm "$radvd_conf" } diff --git a/package/gluon-radvd/files/lib/gluon/radvd/generate_config b/package/gluon-radvd/files/lib/gluon/radvd/generate_config new file mode 100755 index 00000000..7c0e3a92 --- /dev/null +++ b/package/gluon-radvd/files/lib/gluon/radvd/generate_config @@ -0,0 +1,14 @@ +#!/usr/bin/lua + +local site = require 'gluon.site_config' + +print([[ +interface br-client +{ + IgnoreIfMissing on; + AdvSendAdvert on; + AdvDefaultLifetime 0; + + prefix ]] .. site.prefix6 .. [[ {}; +}; +]]) diff --git a/package/gluon-radvd/generate/lib/gluon/radvd/radvd.conf b/package/gluon-radvd/generate/lib/gluon/radvd/radvd.conf deleted file mode 100644 index d112f6fc..00000000 --- a/package/gluon-radvd/generate/lib/gluon/radvd/radvd.conf +++ /dev/null @@ -1,10 +0,0 @@ -interface br-client -{ - IgnoreIfMissing on; - AdvSendAdvert on; - AdvDefaultLifetime 0; - - prefix @prefix6@ - { - }; -};