map-controller: only parse for -w flag if mapagent config exists

This commit is contained in:
Jakob Olsson 2021-05-17 16:03:19 +02:00
parent c2fad5fad2
commit aa34cd098e

View file

@ -14,7 +14,6 @@ handle_controller_select() {
start_service() {
local enabled
local local_ctrl=0
config_load "mapcontroller"
config_get_bool enabled controller enabled 1
@ -23,9 +22,13 @@ start_service() {
procd_open_instance
procd_set_param command "/usr/sbin/mapcontroller" "-d"
config_load "mapagent"
config_foreach handle_controller_select controller_select
[ "$local_ctrl" -eq 0 ] && procd_append_param command "-w"
if [ -f /etc/config/mapagent ]; then
local local_ctrl=0
config_load "mapagent"
config_foreach handle_controller_select controller_select
[ "$local_ctrl" -eq 0 ] && procd_append_param command "-w"
fi
procd_set_param respawn
# procd_set_param stdout 1