|
@@ -18,7 +18,11 @@
|
|
|
# along with PopuFare. If not, see <https://www.gnu.org/licenses/>.
|
|
# along with PopuFare. If not, see <https://www.gnu.org/licenses/>.
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-. $HOME/bin/common_values.sh
|
|
|
|
|
|
|
+export BASEDIR='/home/bus/'
|
|
|
|
|
+
|
|
|
|
|
+echo "## connection_tether-ppp $BASEDIR"
|
|
|
|
|
+
|
|
|
|
|
+. $BASEDIR/bin/common_values.sh
|
|
|
|
|
|
|
|
# Do this once at boot time, but do it again after a tunnel abort request...
|
|
# Do this once at boot time, but do it again after a tunnel abort request...
|
|
|
#
|
|
#
|
|
@@ -80,7 +84,7 @@ perform_post_connect_checkin()
|
|
|
imsi="`output_net_ids_field IMSI`"
|
|
imsi="`output_net_ids_field IMSI`"
|
|
|
mac="`output_net_ids_field ETH0`"
|
|
mac="`output_net_ids_field ETH0`"
|
|
|
|
|
|
|
|
- # Send these gathered data to the update daemon. The leading '#' tells the server that this is a
|
|
|
|
|
|
|
+ # Send these gathered data to the update daemon. The leading '#' tells the server that this is a
|
|
|
#checkin, not an update request.
|
|
#checkin, not an update request.
|
|
|
echo -e "#$busunitnum\t$equipnum\t$mac\t$imei\t$imsi\t$version" | nc -q1 localhost $UPDATE_DAEMON_PORT
|
|
echo -e "#$busunitnum\t$equipnum\t$mac\t$imei\t$imsi\t$version" | nc -q1 localhost $UPDATE_DAEMON_PORT
|
|
|
}
|
|
}
|
|
@@ -89,7 +93,7 @@ perform_post_connect_checkin()
|
|
|
# the network by equipment number, serial number, or bus number. The three parameters are:
|
|
# the network by equipment number, serial number, or bus number. The three parameters are:
|
|
|
#
|
|
#
|
|
|
# 1: The path to the file containing the identifying number
|
|
# 1: The path to the file containing the identifying number
|
|
|
-# 2: The base port number on the remote server to add the identifying number to to get the server-side port that will
|
|
|
|
|
|
|
+# 2: The base port number on the remote server to add the identifying number to to get the server-side port that will
|
|
|
# forward to port 22 (sshd) on the client side.
|
|
# forward to port 22 (sshd) on the client side.
|
|
|
# 3: An optional parameter which if present is taken as a set of command line flags to cut to apply to the contents
|
|
# 3: An optional parameter which if present is taken as a set of command line flags to cut to apply to the contents
|
|
|
# of the file specified by $1 to extract the numeric component (for instance, serial numbers may be in the form XYZ-1234
|
|
# of the file specified by $1 to extract the numeric component (for instance, serial numbers may be in the form XYZ-1234
|
|
@@ -108,7 +112,7 @@ generate_reverse_phonehome_component()
|
|
|
#Grab the desired substring
|
|
#Grab the desired substring
|
|
|
num="`cat $file | cut $cut_cmdline`"
|
|
num="`cat $file | cut $cut_cmdline`"
|
|
|
else
|
|
else
|
|
|
- #Grab its contents
|
|
|
|
|
|
|
+ #Grab its contents
|
|
|
num="`cat $file`";
|
|
num="`cat $file`";
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
@@ -162,7 +166,7 @@ clean_up_after_tunnel_teardown()
|
|
|
#Sleep until it is time to try again
|
|
#Sleep until it is time to try again
|
|
|
/bin/sleep $SLEEP_AFTER_TUNNEL_ABORT
|
|
/bin/sleep $SLEEP_AFTER_TUNNEL_ABORT
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
else
|
|
else
|
|
|
#OTHERWISE, we assume that the modem lost signal, or the router or remote server went wonky...
|
|
#OTHERWISE, we assume that the modem lost signal, or the router or remote server went wonky...
|
|
|
|
|
|
|
@@ -180,7 +184,7 @@ clean_up_after_tunnel_teardown()
|
|
|
debug_print "Sleeping before any retry attempts..."
|
|
debug_print "Sleeping before any retry attempts..."
|
|
|
#Sleep before trying this again...
|
|
#Sleep before trying this again...
|
|
|
/bin/sleep $SLEEP_AFTER_TUNNEL_FAILURE
|
|
/bin/sleep $SLEEP_AFTER_TUNNEL_FAILURE
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
fi
|
|
fi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -192,7 +196,7 @@ while true; do
|
|
|
ssh_fail_counter=0
|
|
ssh_fail_counter=0
|
|
|
debug_print "Attempting to dial..."
|
|
debug_print "Attempting to dial..."
|
|
|
|
|
|
|
|
- # Try to re-"dial" our ISP
|
|
|
|
|
|
|
+ # Try to re-"dial" our ISP
|
|
|
#
|
|
#
|
|
|
/usr/bin/pon gprs
|
|
/usr/bin/pon gprs
|
|
|
|
|
|