linux 命令行脚本

1. cd 到某个路径 执行某个程序

cd /home/hil/HILexe
./HMI 

2.ssh 命令

echo "123456" | sudo -S ssh 192.168.1.18
ssh "-S cd /app && ./app_start.sh && cd bin && ./app"

123456是sudo的密码 ,ssh中执行多个命令用&&隔开

3.adb 命令

adb push /home/hil/HILexe/transfer /usr
adb shell "ifconfig br0 down && ifconfig br0 192.168.1.99 && ifconfig br0 up && cd /usr && chmod 777 transfer && ./transfer"

执行多个命令用&&隔开

4.清空共享内存块

ipcrm -M 0x000004d2
cd /home/hil/HILexe
./recvWarnMysql

5.sleep15秒 VTD切换场景

sleep 15
/home/hil/VTD.2.2/Runtime/Tools/ScpGenerator/scpGenerator -w -p 48179 -i ''
/home/hil/VTD.2.2/Runtime/Tools/ScpGenerator/scpGenerator -w -p 48179 -i ''
/home/hil/VTD.2.2/Runtime/Tools/ScpGenerator/scpGenerator -w -p 48179 -i ''
/home/hil/VTD.2.2/Runtime/Tools/ScpGenerator/scpGenerator -w -p 48179 -i ''

6.修改网卡配置 启动VTD

echo "123456" | sudo -S ifconfig eno1 down
echo "123456" | sudo -S ifconfig eno1 hw ether 80:E8:2C:25:C0:55
echo "123456" | sudo -S ifconfig eno1 up
echo "123456" | sudo -S ifconfig eno1 192.168.1.149
echo "123456" | sudo -S ifconfig eno1 up
cd /home/hil/VTD.2.2/bin
./vtdStart.sh --project=FCW

7.启动OBS

cd /usr/share/applications
obs

 

你可能感兴趣的:(linux,tips)