aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorHelge Mader <ma@dev.tdt.de>2023-01-11 10:33:10 +0100
committerHelge Mader <ma@dev.tdt.de>2023-01-11 11:49:17 +0100
commitc80fc6c3430ee0c01aea2fe3a0dfa1ad220d330b (patch)
treee4325db0f4c28b737c983dbcdc36aac73f9d8b05 /net
parent8f68e1bd911dd4cab5d11199f65f78f97bc4faf9 (diff)
xinetd: add processing of redirect option in init script
Signed-off-by: Helge Mader <ma@dev.tdt.de>
Diffstat (limited to 'net')
-rw-r--r--net/xinetd/Makefile2
-rw-r--r--net/xinetd/files/xinetd.init17
2 files changed, 17 insertions, 2 deletions
diff --git a/net/xinetd/Makefile b/net/xinetd/Makefile
index 62e90bdde..1d52a1b5e 100644
--- a/net/xinetd/Makefile
+++ b/net/xinetd/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=xinetd
PKG_VERSION:=2.3.15
-PKG_RELEASE:=13
+PKG_RELEASE:=14
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/xinetd-org/xinetd/archive
diff --git a/net/xinetd/files/xinetd.init b/net/xinetd/files/xinetd.init
index 9e3872fce..5e89b5b63 100644
--- a/net/xinetd/files/xinetd.init
+++ b/net/xinetd/files/xinetd.init
@@ -62,7 +62,22 @@ config_cb() {
local option="$1"
local value="$2"
- [ -n "$value" ] && [ "$option" != "name" ] && echo -e "\t$option = $value" >> $GENERATED_CONF_FILE
+ # for the redirect option we have to convert the '[ip address]:port' notation
+ # in config file to 'ip_address port' in the xinetd config file
+ if [ "$option" = "redirect" ] && [ -n "$value" ]; then
+ local redirect_ip=""
+ local redirect_port=""
+
+ redirect_ip="$(echo ${value%:*})"
+ redirect_ip="$(echo ${redirect_ip//\[/})"
+ redirect_ip="$(echo ${redirect_ip//\]/})"
+
+ redirect_port="$(echo ${value##*:})"
+
+ echo -e "\t$option = $redirect_ip $redirect_port" >> $GENERATED_CONF_FILE
+ else
+ [ -n "$value" ] && [ "$option" != "name" ] && echo -e "\t$option = $value" >> $GENERATED_CONF_FILE
+ fi
}
# redefined callback for lists when calling config_load