xxx
This commit is contained in:
		@@ -80,9 +80,6 @@ if [ ! -d bin ]; then mkdir bin; fi
 | 
				
			|||||||
if [ -f ./bin/poly_pkt_fwd ]; then rm ./bin/poly_pkt_fwd; 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
 | 
					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
 | 
					# Restore location back to where we started the install
 | 
				
			||||||
 | 
					
 | 
				
			||||||
popd
 | 
					popd
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -79,7 +79,9 @@ popd
 | 
				
			|||||||
if [ ! -d bin ]; then mkdir bin; fi
 | 
					if [ ! -d bin ]; then mkdir bin; fi
 | 
				
			||||||
if [ -f ./bin/poly_pkt_fwd ]; then rm ./bin/poly_pkt_fwd; 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
 | 
					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
 | 
					# Restore location back to where we started the install
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -60,9 +60,9 @@ echo ""
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# load the region-appropriate global conf
 | 
					# 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
 | 
					then
 | 
				
			||||||
	sleep 1
 | 
						echo Successfully loaded $GATEWAY_REGION-global-conf.json from TTN repo
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	echo "******************"
 | 
						echo "******************"
 | 
				
			||||||
    echo "ERROR: GATEWAY_REGION not found"
 | 
					    echo "ERROR: GATEWAY_REGION not found"
 | 
				
			||||||
@@ -73,7 +73,7 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# create local.conf
 | 
					# 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
 | 
					# Reset gateway ID based on MAC
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -60,14 +60,12 @@ echo ""
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# load the region-appropriate global conf
 | 
					# 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
 | 
					if curl --fail "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 ]
 | 
					 | 
				
			||||||
then
 | 
					then
 | 
				
			||||||
 | 
						sleep 1
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
	echo "******************"
 | 
						echo "******************"
 | 
				
			||||||
    echo "ERROR: GATEWAY_REGION not found: $err"
 | 
					    echo "ERROR: GATEWAY_REGION not found"
 | 
				
			||||||
	echo "******************"
 | 
						echo "******************"
 | 
				
			||||||
    while true; do sleep 10; done # don't exit in resin
 | 
					    while true; do sleep 10; done # don't exit in resin
 | 
				
			||||||
    exit 1
 | 
					    exit 1
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user