From fbe302bf294c78154ed1c6ef420c87a65911bd80 Mon Sep 17 00:00:00 2001 From: Albrecht Lohofener Date: Thu, 26 Sep 2024 00:17:59 +0200 Subject: [PATCH] Usage of only one multirun call. --- src/init_container.sh | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/init_container.sh b/src/init_container.sh index 296fdbf..563a2af 100644 --- a/src/init_container.sh +++ b/src/init_container.sh @@ -58,23 +58,19 @@ lsusb >> /var/www/system_info.txt cp -r /var/www/* /run/shm # ******* LuCi forwarding handling ******* -if [[ $FORWARD_LUCI = "true" ]]; then - if [[ $LAN_IF = "veth" ]]; then - info "Enable LuCI forwading to host LAN at port 9000" - - exec multirun \ - "qemu-openwrt-web-backend" \ - "nginx" \ - "/run/run_openwrt.sh" \ - "nsenter --target 1 --uts --net --ipc nginx -c /var/www/nginx-luci.conf" \ - - else - warn "LuCI forwading is only available if enviroment variable is set to LAN_IF: 'veth'" +if [[ $FORWARD_LUCI = "true" && $LAN_IF = "veth" ]]; then + info "Enable LuCI forwarding to host LAN at port 9000" + LUCI_COMMAND="nsenter --target 1 --uts --net --ipc nginx -c /var/www/nginx-luci.conf" +else + if [[ $FORWARD_LUCI = "true" ]]; then + warn "LuCI forwarding is only available if environment variable is set to LAN_IF: 'veth'" fi + LUCI_COMMAND="" fi # Start processes exec multirun \ "qemu-openwrt-web-backend" \ "nginx" \ - "/run/run_openwrt.sh" \ No newline at end of file + "/run/run_openwrt.sh" \ + $LUCI_COMMAND