From be08efa9dd92e31858d80a9ce37a84a0a9195dce Mon Sep 17 00:00:00 2001 From: Ray Ozzie Date: Tue, 22 Mar 2016 11:45:20 -0700 Subject: [PATCH] xxx --- resin-run.sh | 23 ++++++++++++----------- resin-run.sh~ | 14 +++----------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/resin-run.sh b/resin-run.sh index bbe306d..701ee68 100755 --- a/resin-run.sh +++ b/resin-run.sh @@ -1,13 +1,5 @@ #! /bin/bash -# Display the environment, which is useful when debugging - -echo "******************" -echo "*** Environment:" -env -echo "******************" -echo "" - # Configure the global and local configuration files via the environment echo "******************" @@ -60,9 +52,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 - echo Successfully loaded $GATEWAY_REGION-global-conf.json from TTN repo + echo Successfully loaded $GATEWAY_REGION-global_conf.json from TTN repo else echo "******************" echo "ERROR: GATEWAY_REGION not found" @@ -73,7 +65,16 @@ fi # create local.conf -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 +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 e4286c3..769902a 100755 --- a/resin-run.sh~ +++ b/resin-run.sh~ @@ -1,13 +1,5 @@ #! /bin/bash -# Display the environment, which is useful when debugging - -echo "******************" -echo "*** Environment:" -env -echo "******************" -echo "" - # Configure the global and local configuration files via the environment echo "******************" @@ -60,9 +52,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 +65,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