#!/bin/sh
echo  step 0.Run upgrade_ap_software.sh, need 12 step!
echo  step 1.sleep 2 s.
sleep 2

echo  step 2.cd /tmp/upgrade/.
cd /tmp/upgrade/

echo  step 3./home/seekcy_blg/kill_all.sh.
/home/seekcy_blg/kill_all.sh
/home/seekcy_blg/kill_all.sh
echo  step 4.rm -rf /home/seekcy_blg_bak.
rm -rf /home/seekcy_blg_bak
echo  step 5.mv /home/seekcy_blg /home/seekcy_blg_bak.
mv /home/seekcy_blg /home/seekcy_blg_bak
echo  step 6.tar -vxf seekcy_blg.tar.
tar -vxf seekcy_blg.tar
echo  step 7.cp -rf seekcy_blg /home/.
cp -rf seekcy_blg /home/
# start new version
echo  step 8.cd /home/seekcy_blg/ chmod 755 *
cd    /home/seekcy_blg/
chmod 755 *
echo  step 9.Start new version blg, run_all.sh!
./run_inithook.sh
./run_all.sh
./run_afterhook.sh
# timer to return last version
killall return_version.sh
killall return_version.sh

echo  step 10.cd /home/seekcy_blg_bak/ run return_version.sh
cd /home/seekcy_blg_bak/
./return_version.sh
