1.死循环循环升级,因为标志位的问题
ERR:
#这个标志是专门针对bike.tar的
echo "1" > /usr/bike/conf/UpdataFlag
ls -l $tmppath
tar -vxzf $tmppath/packet.tar.gz -C /
code=$?
if [ "$code" -ne "0" ]; then
echo "ERR: tar -vxzf $tmppath/packet.tar.gz -C /"
echo "解压失败"
rm -rf $exedir/conf/VersionAutoupdate
else
echo "OK: tar -vxzf $tmppath/packet.tar.gz -C /"
kill -9 `pgrep -f /usr/bike/shell/reboot`
fi
kill -9 `pgrep -f /usr/bike/test/app_watchdog`
kill -9 `pgrep -f EmbedSky_wdg`
echo "**************** reboot ****************"
sleep 1
reboot
OK:
#这个标志是专门针对bike.tar的
echo "0" > /usr/bike/conf/UpdataFlag
ls -l $tmppath
tar -vxzf $tmppath/packet.tar.gz -C /
code=$?
if [ "$code" -ne "0" ]; then
echo "ERR: tar -vxzf $tmppath/packet.tar.gz -C /"
echo "解压失败"
rm -rf $exedir/conf/VersionAutoupdate
else
echo "OK: tar -vxzf $tmppath/packet.tar.gz -C /"
kill -9 `pgrep -f /usr/bike/shell/reboot`
fi
kill -9 `pgrep -f /usr/bike/test/app_watchdog`
kill -9 `pgrep -f EmbedSky_wdg`
echo "**************** reboot ****************"
sleep 1
reboot
2.shell获取进程id
PROCESS_NUM=`pgrep -f /usr/bike/shell/autoupdate.sh`
kill -9 `pgrep -f /usr/bike/shell/autoupdate.sh`
3.ps进程,登录乱码如何解决
#/etc/inittab
::sysinit:/etc/init.d/rcS
#console::askfirst:-/bin/sh
::once:/usr/sbin/telnetd -l /bin/login
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
#::respawn:/sbin/getty -L ttySAC0 115200 vt100
::respawn:/sbin/getty -L tq2440_serial0 115200 vt100