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 09:54:03 +0000 (17:54 +0800)
Introduce `log_stdout` and `log_stderr` options for managing logging output.

Signed-off-by: Ray Wang <r@hev.cc>
net/natmap/Makefile
net/natmap/files/natmap.config
net/natmap/files/natmap.init

index 6e43a8f4e5edf12d46c8c32857cf427a18062953..47809d46e19234b714a6be1d45c2610c69eec9dd 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
 }