diff options
author | Jason Reiss <jreiss@multitech.com> | 2016-11-10 09:27:49 -0600 |
---|---|---|
committer | Jason Reiss <jreiss@multitech.com> | 2016-11-10 09:27:49 -0600 |
commit | 75fd65e9f52aeea9ab27b4af85c1fa8b093e5be3 (patch) | |
tree | f75f80dda03d935b96107e4c54b85eb8e3ccfa9e /recipes-connectivity/lora | |
parent | fe4ec81b4aa74350b17f5b78aa438e09e0a2060c (diff) | |
download | meta-mlinux-75fd65e9f52aeea9ab27b4af85c1fa8b093e5be3.tar.gz meta-mlinux-75fd65e9f52aeea9ab27b4af85c1fa8b093e5be3.tar.bz2 meta-mlinux-75fd65e9f52aeea9ab27b4af85c1fa8b093e5be3.zip |
lora: copy default global_conf file only if hardware has changed.
Diffstat (limited to 'recipes-connectivity/lora')
-rwxr-xr-x | recipes-connectivity/lora/lora-network-server/lora-network-server.init | 16 |
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 |