脚本
#!/bin/sh
lines=12
temptar=/tmp/qoe.tgz
workpath=/tmp/qoe
tail -n +$lines $0 >${temptar}
tar xzf ${temptar} -C /tmp
rm -rf ${temptar}
cd ${workpath}
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/upt/framework/saf/rootfs/usr/lib:/opt/upt/framework/saf/rootfs/lib
./testapp -daemon
exit 0
新建一个目录,把运行需要的所有文件拷贝进去,然后使用tar命令进行打包:
tar -czvf qoe.tgz qoe/
cat install.sh qoe.tgz > qoe.bin
chmod +x qoe.bin
分离
sed -n '1,/^exit 0/!p' aas-jiami-install.bin > a.tar.gz