diff options
-rwxr-xr-x | recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init index 8c0894a..9ffaf6d 100755 --- a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init +++ b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init @@ -11,6 +11,7 @@ run_dir=/var/run/lora pkt_fwd=/opt/lora/lora_pkt_fwd pkt_fwd_pidfile=$run_dir/lora-pkt-fwd-1.pid log_file=/var/log/lora-pkt-fwd.log +cfg_file=/opt/lora/global_conf.json do_start() { echo "Starting $NAME: " @@ -18,8 +19,8 @@ do_start() { eui=$(mts-io-sysfs show lora/eui) # Remove colons clean_eui="${eui//:/}" - echo "Setting gateway_id in global_conf.json to $clean_eui" - sed -i "s/\"gateway_ID\": \".*\"/\"gateway_ID\": \"$clean_eui\"/" global_conf.json + echo "Setting gateway_id in $cfg_file to $clean_eui" + sed -i "s/\"gateway_ID\": \".*\"/\"gateway_ID\": \"$clean_eui\"/" $cfg_file mkdir -p $run_dir |