arm 自动升级脚本
来源:互联网 发布:淘宝卖家在哪里 编辑:程序博客网 时间:2024/05/24 01:46
哈哈,试验成功了,效果还不错!!
#SubtitleServer autoupdate script.
#author:zhangshaoyan
#date:January 14,2016.
LocalAppFile=SubtitleServer_Local
LocalMD5File=${LocalAppFile}.md5
RemoteAppFile=SubtitleServer
RemoteMD5File=${RemoteAppFile}.md5
FTPServer=172.23.142.82
#download md5 file from server.
ftp -n <<EOF
open $FTPServer
user root root
binary
get $RemoteMD5File
close
bye
EOF
#check local md5 file.
if [ ! -f $LocalMD5File ];then
echo "can't find $LocalMD5File !"
exit -1
fi
#check download success or not.
if [ ! -f $RemoteMD5File ];then
echo "Can't find $RemoteMD5File !"
exit -1
fi
#extract two md5 values.
LocalMD5Value=$(cat $LocalMD5File | awk '{print $1}')
RemoteMD5Value=$(cat $RemoteMD5File | awk '{print $1}')
echo "LocalMD5:" $LocalMD5Value
echo "RemoteMD5:" $RemoteMD5Value
#compare two md5 values.
if [ ${LocalMD5Value} = ${RemoteMD5Value} ];then
echo "No need to update,exit"
exit 0
fi
echo "execute update process..."
#backup current version.
mv $LocalAppFile ${LocalAppFile}.backup
mv $LocalMD5File ${LocalMD5File}.backup
#download new version from ftp server.
ftp -n <<EOF
open $FTPServer
user root root
binary
get $RemoteAppFile
get $RemoteMD5File
close
bye
EOF
#add executive permission.
chmod +x $RemoteAppFile
#fix its name.
mv $RemoteAppFile $LocalAppFile
mv $RemoteMD5File $LocalMD5File
echo "update done!"
#this is the end of file.
下面是试验结果:
shell.albert@zhangshaoyan:~/project/NXPiMX53/SubtitleServer/update> ls
autoupdate.sh SubtitleServer_Local SubtitleServer_Local.md5
shell.albert@zhangshaoyan:~/project/NXPiMX53/SubtitleServer/update> ./autoupdate.sh
Connected to 172.23.142.82.
220 Operation successful
230 Operation successful
Remote system type is UNIX.
Using binary mode to transfer files.
200 Operation successful
local: SubtitleServer.md5 remote: SubtitleServer.md5
229 EPSV ok (|||57693|)
150 Opening BINARY connection for SubtitleServer.md5 (49 bytes)
100% |*************************************************************************************************| 49 736.17 KiB/s 00:00 ETA
226 Operation successful
49 bytes received in 00:00 (341.79 KiB/s)
Can't parse time `19700001032226'.
221 Operation successful
LocalMD5: 335c6c59831f093a276391d89f08126d
RemoteMD5: bd0940afc3bd94262d9f076d27d2ccd6
execute update process...
Connected to 172.23.142.82.
220 Operation successful
230 Operation successful
Remote system type is UNIX.
Using binary mode to transfer files.
200 Operation successful
local: SubtitleServer remote: SubtitleServer
229 EPSV ok (|||51800|)
150 Opening BINARY connection for SubtitleServer (1047787 bytes)
100% |*************************************************************************************************| 1023 KiB 11.21 MiB/s 00:00 ETA
226 Operation successful
1047787 bytes received in 00:00 (11.20 MiB/s)
Can't parse time `19700001025835'.
local: SubtitleServer.md5 remote: SubtitleServer.md5
229 EPSV ok (|||35470|)
150 Opening BINARY connection for SubtitleServer.md5 (49 bytes)
100% |*************************************************************************************************| 49 1.06 MiB/s 00:00 ETA
226 Operation successful
49 bytes received in 00:00 (455.72 KiB/s)
Can't parse time `19700001032226'.
221 Operation successful
update done!
shell.albert@zhangshaoyan:~/project/NXPiMX53/SubtitleServer/update> echo $?
0
shell.albert@zhangshaoyan:~/project/NXPiMX53/SubtitleServer/update>
- arm 自动升级脚本
- EF 自动升级至最新脚本
- EAVCapture项目中的开机自动升级脚本
- 第一天 自动升级脚本部署
- 切合OTA升级的版本升级包自动生成脚本
- CentOS无缝升级nginx[完整命令及自动升级脚本]
- 基于ARM的嵌入式Bootloader实现自动升级
- [Android]升级SDK tools后ant自动编译脚本错误
- 升级到xcode9 shell脚本自动打包失败
- ARM-Linux应用程序自动升级以及自动回滚的实现
- ARM IAP升级方法
- 利用ant脚本 自动构建svn全量/增量/减量 项目升级包
- 利用ant脚本 自动构建svn增量/全量 系统程序升级包
- 副标题:利用ant脚本 自动构建svn增量/全量 系统程序升级包
- 利用ant脚本 自动构建svn增量/全量 系统程序升级包
- 利用ant脚本 自动构建svn增量/全量 系统程序升级包
- 程序猿利器(二) sql server 存储过程升级脚本自动合并
- 利用ant脚本 自动构建svn增量/全量 系统程序升级包
- 【第十章】集成其它Web框架 之 10.3 集成Struts2.x ——跟我学spring3
- 强烈推荐android studio用的几个插件
- php中英文逗号分号转换等
- 一个类所实现的两个不同的接口中,有同名的方法,怎么知道实现的是哪个接口中的方法
- 实现两个对象之间每个值的交换
- arm 自动升级脚本
- java中的 泛型类、泛型方法、泛型接口
- 第2章第1节练习题1 判断栈的操作次序是否合法
- C++ socket传输结构体
- 关于查看所有的svn命令
- 使用cocoaPods导入第三方库, import没有提示
- 全城最浪漫的颜值影城在这
- OpenCV视频剪切
- 数据结构--堆