Procházet zdrojové kódy

put in it's own subdirectory to do the install

Abram Connelly před 6 roky
rodič
revize
b21801f289
1 změnil soubory, kde provedl 44 přidání a 32 odebrání
  1. 44 32
      busunit/scripts/package_install.sh

+ 44 - 32
busunit/scripts/package_install.sh

@@ -20,6 +20,8 @@
 
 echo "# Popufare DIU package installer script"
 
+tarball="package.tgz"
+
 BINDIR="/home/bus/bin"
 CONFIGDIR="/home/bus/config"
 BINLIST="avls billdb client_supervisor debug_client diu_minder gps_minder ipc_server paddlemgr passdb piu_minder send_billing_record send_magstrip"
@@ -30,46 +32,56 @@ if [[ ! -e /home/bus/config/popufare.witness ]] ; then
   exit 0
 fi
 
-if [[ ! -e ./popufare.witness ]] ; then
-  echo "# Could not find local 'popufare.witness'. Are you sure you're installing this from a package?"
-  echo ""
-  exit 1
-fi
+killall client_supervisor ; sleep 5 ;
 
-./build_all.sh native
+tmpdir=`mktemp -d`
+tar -C $tmpdir -zxf $tarball
+pushd $tmpdir > /dev/null
 
-killall client_supervisor ; sleep 5 ;
+  if [[ ! -e ./popufare.witness ]] ; then
+    echo "# Could not find local 'popufare.witness'. Are you sure you're installing this from a package?"
+    echo ""
 
-# These represent the most common files that are going to need to be
-# updated.
-# Other system files, like rc.local, the PPP config files, etc.
-# can also be updated as needed, but for now the focus is on
-# the binaries and scripts located in /home/bus/.
-#
-for binfn in $BINDLIST ; do
-  rm -f $BINDIR/$binfn
-  cp -L bin/native/$binfn $BINDIR/$binfn
-done
+    popd > /dev/null
 
-for scriptfn in $SCRIPTLIST ; do
-  rm -f $BINDIR/$scriptfn
-  cp -L scripts/$scriptfn $BINDIR/$scriptfn
-done
+    rm -rf $tmpdir
+    exit 1
+  fi
 
-rm -rf $CONFIGDIR/html
-cp -L -R DIUv2/html $CONFIGDIR/
+  ./build_all.sh native
 
-# Misc. scripts/programs missed by the above
-#
-rm -f $BINDIR/diu_kiosk
-cp -L DIUv2/diu_kiosk $BINDIR/
+  # These represent the most common files that are going to need to be
+  # updated.
+  # Other system files, like rc.local, the PPP config files, etc.
+  # can also be updated as needed, but for now the focus is on
+  # the binaries and scripts located in /home/bus/.
+  #
+  for binfn in $BINDLIST ; do
+    rm -f $BINDIR/$binfn
+    cp -L bin/native/$binfn $BINDIR/$binfn
+  done
 
-rm -f $BINDIR/reset-gps
-cp -L scripts/reset-gps.py $BINDIR/reset-gps
+  for scriptfn in $SCRIPTLIST ; do
+    rm -f $BINDIR/$scriptfn
+    cp -L scripts/$scriptfn $BINDIR/$scriptfn
+  done
 
-# Indicate we have a Popufare installation
-#
-touch $CONFIGDIR/popufare.witness
+  rm -rf $CONFIGDIR/html
+  cp -L -R DIUv2/html $CONFIGDIR/
+
+  # Misc. scripts/programs missed by the above
+  #
+  rm -f $BINDIR/diu_kiosk
+  cp -L DIUv2/diu_kiosk $BINDIR/
+
+  rm -f $BINDIR/reset-gps
+  cp -L scripts/reset-gps.py $BINDIR/reset-gps
+
+  # Indicate we have a Popufare installation
+  #
+  touch $CONFIGDIR/popufare.witness
+
+popd > /dev/null
 
 sleep 1
 touch /tmp/reboot_flag