summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrecipes-connectivity/lora/lora-network-server/lora-network-server.init16
1 files changed, 9 insertions, 7 deletions
diff --git a/recipes-connectivity/lora/lora-network-server/lora-network-server.init b/recipes-connectivity/lora/lora-network-server/lora-network-server.init
index 75e43c9..d59a851 100755
--- a/recipes-connectivity/lora/lora-network-server/lora-network-server.init
+++ b/recipes-connectivity/lora/lora-network-server/lora-network-server.init
@@ -52,20 +52,22 @@ card_found() {
fi
if [[ "$lora_id" =~ "$lora_us_id" ]] || [[ "$lora_id" =~ "$lora_eu_id" ]]; then
+ GLOBAL_CONF=/opt/lora/global_conf.json.MTAC_LORA_1_0
if [ "$lora_hw" = "$lora_hw" ] && [[ ! "$lora_id" =~ .*-SPI ]]; then
- cp /opt/lora/global_conf.json.MTAC_LORA_1_0 /opt/lora/global_conf.json
ln -sf /opt/lora/basic_pkt_fwd-usb $pkt_fwd
- return 0
else
- if [ "$lora_hw" = "$lora_1_0_hw" ]; then
- cp /opt/lora/global_conf.json.MTAC_LORA_1_0 /opt/lora/global_conf.json
- fi
if [ "$lora_hw" = "$lora_1_5_h_hw" ]; then
- cp /opt/lora/global_conf.json.MTAC_LORA_1_5 /opt/lora/global_conf.json
+ GLOBAL_CONF=/opt/lora/global_conf.json.MTAC_LORA_1_5
fi
ln -sf /opt/lora/lora_pkt_fwd $pkt_fwd
- return 0
fi
+
+ diff $GLOBAL_CONF /opt/lora/global_conf.json
+ if [ $? -ne 0 ]; then
+ cp $GLOBAL_CONF /opt/lora/global_conf.json
+ fi
+
+ return 0
else
return 1
fi