clementinecomputing 6 年 前
コミット
0cdc14063d
2 ファイル変更32 行追加19 行削除
  1. 1 1
      busunit/scripts/init_bus.sh
  2. 31 18
      busunit/scripts/update_loop.sh

+ 1 - 1
busunit/scripts/init_bus.sh

@@ -32,7 +32,7 @@ echo " Done."
 if [[ "$USEGPRS" == 1 ]] ; then
 	/etc/ppp/ppp-dialer.sh &
 else
-  $BASEDIR/bin/setup_test_tunnel.sh &
+  $BASEDIR/bin/connection_tether.sh &
 fi
 
 # Start the client monitor (which then goes and starts everything else...)

+ 31 - 18
busunit/scripts/update_loop.sh

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Copyright (c) 2019 Clementine Computing LLC.
 # 
@@ -37,10 +37,26 @@ function spawn_supervisor
   # If we have a client supervisor binary to run
   #
   if [ -f $BASEDIR/bin/client_supervisor ]; then
+
+#    # If we also have a config file for the UI
+#    #
+#    if [ -f $BASEDIR/config/menu.xml ]; then
+#      rm $supervisor_pidfile
+#
+#      # then run the whole shebang...
+#      #
+#      $BASEDIR/bin/client_supervisor $supervisor_args &
+#      echo $! > $supervisor_pidfile
+#      echo Spawned client_supervisor. PID = `cat $supervisor_pidfile`
+#
+#    # if we DON'T have one, we still need to download a config before we're viable...
+#    #
+#    else
+#      rm -f config.tgz.*
+#      $BASEDIR/bin/showmessage -b "Downloading Config..."
+#    fi
+
     
-    # If we also have a config file for the UI
-    #
-    if [ -f $BASEDIR/config/menu.xml ]; then
       rm $supervisor_pidfile
 
       # then run the whole shebang...
@@ -49,13 +65,6 @@ function spawn_supervisor
       echo $! > $supervisor_pidfile
       echo Spawned client_supervisor. PID = `cat $supervisor_pidfile`
 
-    # if we DON'T have one, we still need to download a config before we're viable...
-    #
-    else
-      rm -f config.tgz.*
-      $BASEDIR/bin/showmessage -b "Downloading Config..."
-    fi
-  
   # If we DON'T have one, we are either a new system or just badly broken so...
   #
   else
@@ -65,6 +74,8 @@ function spawn_supervisor
     rm -f  $BASEDIR/config/*.tgz.*
     $BASEDIR/bin/showmessage -b "Wait (~ 15 min)"
 
+    echo "..."
+
   fi
 }
 
@@ -78,7 +89,7 @@ function check_update
     else
       echo -en "0"
     fi
-    
+
     for file in `ls $checksum_path/*.checksum`; do 
       echo -en "\t`echo $file | sed -r 's/^.*\/(.*)\.checksum$/\1/'`=`cat $file`"; 
     done; 
@@ -88,7 +99,9 @@ function check_update
 
 
 while true; do
-  
+
+  echo "## heartbeat"
+
   #See if we need to spawn our client supervisor
   if [ ! -f $supervisor_pidfile ]; then
     spawn_supervisor;
@@ -105,7 +118,7 @@ while true; do
   check_update | 
     (
       while read client_file checksum file_size server_path file_version; do
-        
+
         # If we've been asked to abort this update, do so before we start downloading if possible
         #
         if [ -f $UPDATE_ABORT_DROPFILE ]; then
@@ -132,12 +145,12 @@ while true; do
         # Initiate a secure download to fetch this package down from the server
         #
         scp -i $SSH_IDENTITY $SCP_OPTIONS -P $SSH_PORT $SSH_TARGET:$server_path /tmp/$client_file
-      
+
         # If we've already downloaded when we get the abort message
         #
         if [ -f $UPDATE_ABORT_DROPFILE ]; then
           echo "Aborting update on request!";
-          
+
           # Clean up after ourselves
           #
           rm -f /tmp/$client_file.expected_size /tmp/$client_file.expected_md5
@@ -159,7 +172,7 @@ while true; do
         # If we indeed _got_ a file to begin with...  
         #
         if [ -f /tmp/$client_file ]; then
-          
+
           # Start a subshell in which we...
           #
           (
@@ -174,7 +187,7 @@ while true; do
             $BASEDIR/bin/apply_update.sh $client_file $checksum $file_size $server_path $file_version
           );
         fi
-      
+
         # Clean up after ourselves (removing our during-update dropfiles)  
         #
         rm -f /tmp/$client_file.expected_size /tmp/$client_file.expected_md5