From 634a35e96c6d47126c1a6218969faddec41e2a3c Mon Sep 17 00:00:00 2001 From: Ray Ozzie Date: Tue, 22 Mar 2016 11:26:14 -0700 Subject: [PATCH] xxx --- resin-install.sh | 3 --- resin-install.sh~ | 4 +++- resin-run.sh | 6 +++--- resin-run.sh~ | 10 ++++------ 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/resin-install.sh b/resin-install.sh index 72fb37a..6c9aa15 100755 --- a/resin-install.sh +++ b/resin-install.sh @@ -80,9 +80,6 @@ if [ ! -d bin ]; then mkdir bin; fi if [ -f ./bin/poly_pkt_fwd ]; then rm ./bin/poly_pkt_fwd; fi ln -s $INSTALL_DIR/packet_forwarder/poly_pkt_fwd/poly_pkt_fwd ./bin/poly_pkt_fwd -# copy initial global configuration file -# cp -f ./packet_forwarder/poly_pkt_fwd/global_conf.json ./bin/global_conf.json - # Restore location back to where we started the install popd diff --git a/resin-install.sh~ b/resin-install.sh~ index 4898fec..72fb37a 100755 --- a/resin-install.sh~ +++ b/resin-install.sh~ @@ -79,7 +79,9 @@ popd if [ ! -d bin ]; then mkdir bin; fi if [ -f ./bin/poly_pkt_fwd ]; then rm ./bin/poly_pkt_fwd; fi ln -s $INSTALL_DIR/packet_forwarder/poly_pkt_fwd/poly_pkt_fwd ./bin/poly_pkt_fwd -cp -f ./packet_forwarder/poly_pkt_fwd/global_conf.json ./bin/global_conf.json + +# copy initial global configuration file +# cp -f ./packet_forwarder/poly_pkt_fwd/global_conf.json ./bin/global_conf.json # Restore location back to where we started the install diff --git a/resin-run.sh b/resin-run.sh index e4286c3..bbe306d 100755 --- a/resin-run.sh +++ b/resin-run.sh @@ -60,9 +60,9 @@ echo "" # load the region-appropriate global conf -if curl --fail "https://raw.githubusercontent.com/rayozzie/ttn-gateway-conf/master/$GATEWAY_REGION-global-conf.json --output ./global-conf.json +if curl --fail https://raw.githubusercontent.com/rayozzie/ttn-gateway-conf/master/$GATEWAY_REGION-global-conf.json --output ./global-conf.json then - sleep 1 + echo Successfully loaded $GATEWAY_REGION-global-conf.json from TTN repo else echo "******************" echo "ERROR: GATEWAY_REGION not found" @@ -73,7 +73,7 @@ fi # create local.conf -echo -e "{\n\t\"gateway_conf\": {\n\t\t\"gateway_ID\": \"0000000000000000\",\n\t\t\"servers\": [ { \"server_address\": \"croft.thethings.girovito.nl\", \"serv_port_up\": 1700, \"serv_port_down\": 1701, \"serv_enabled\": true } ],\n\t\t\"ref_latitude\": $GATEWAY_LAT,\n\t\t\"ref_longitude\": $GATEWAY_LON,\n\t\t\"ref_altitude\": $GATEWAY_ALT,\n\t\t\"contact_email\": \"$GATEWAY_EMAIL\",\n\t\t\"description\": \"$GATEWAY_NAME\" \n\t}\n}" >./local_conf.json +echo -e "{\n\t\"gateway_conf\": {\n\t\t\"gateway_ID\": \"0000000000000000\",\n\t\t\"ref_latitude\": $GATEWAY_LAT,\n\t\t\"ref_longitude\": $GATEWAY_LON,\n\t\t\"ref_altitude\": $GATEWAY_ALT,\n\t\t\"contact_email\": \"$GATEWAY_EMAIL\",\n\t\t\"description\": \"$GATEWAY_NAME\" \n\t}\n}" >./local_conf.json # Reset gateway ID based on MAC diff --git a/resin-run.sh~ b/resin-run.sh~ index 8abe4bc..e4286c3 100755 --- a/resin-run.sh~ +++ b/resin-run.sh~ @@ -60,14 +60,12 @@ echo "" # load the region-appropriate global conf -echo eval curl "https://raw.githubusercontent.com/rayozzie/ttn-gateway-conf/master/$GATEWAY_REGION-global-conf.json --output ./global-conf.json - -eval curl "https://raw.githubusercontent.com/rayozzie/ttn-gateway-conf/master/$GATEWAY_REGION-global-conf.json --output ./global-conf.json -err=$? -if [ $err -ne 0 ] +if curl --fail "https://raw.githubusercontent.com/rayozzie/ttn-gateway-conf/master/$GATEWAY_REGION-global-conf.json --output ./global-conf.json then + sleep 1 +else echo "******************" - echo "ERROR: GATEWAY_REGION not found: $err" + echo "ERROR: GATEWAY_REGION not found" echo "******************" while true; do sleep 10; done # don't exit in resin exit 1