natmap: add log_std{out,err} options
authorRay Wang <r@hev.cc>
Sat, 20 Apr 2024 14:53:03 +0000 (22:53 +0800)
committerTianling Shen <cnsztl@gmail.com>
Wed, 24 Apr 2024 16:26:57 +0000 (00:26 +0800)
Introduce `log_stdout` and `log_stderr` options for managing logging output.

Signed-off-by: Ray Wang <r@hev.cc>
(cherry picked from commit 5abbd3bcb2362963a2cc49c0a9de78dd5c5af185)

net/natmap/Makefile
net/natmap/files/natmap.config
net/natmap/files/natmap.init

index fa8121937b18f75860ec6d0db5f4551b8116efd4..071ef0c89977fc4e81ae48a5e6a2e0165e84ec9d 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=natmap
 PKG_VERSION:=20240303
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/heiher/natmap/releases/download/$(PKG_VERSION)
index 6e8862b3341432c181e0e18879ccacfbdd31af79..c003fc59de8841875293a9c3961afe3a6e9258af 100644 (file)
@@ -10,4 +10,6 @@ config natmap
        option forward_target ''
        option forward_port ''
        option notify_script ''
+       option log_stdout '1'
+       option log_stderr '1'
 
index a0ec4b26df53b6167344109984c2955f839bc05d..bfead56f93181e0c276cfa565b797238a46409b4 100644 (file)
@@ -27,7 +27,9 @@ validate_section_natmap() {
                'port:port' \
                'forward_target:host' \
                'forward_port:port' \
-               'notify_script:file'
+               'notify_script:file' \
+               'log_stdout:bool:1' \
+               'log_stderr:bool:1'
 }
 
 natmap_instance() {
@@ -63,8 +65,8 @@ natmap_instance() {
        procd_append_param command -e /usr/lib/natmap/update.sh
 
        procd_set_param respawn
-       procd_set_param stdout 1
-       procd_set_param stderr 1
+       procd_set_param stdout "${log_stdout}"
+       procd_set_param stderr "${log_stderr}"
 
        procd_close_instance
 }