文件名:
test.sh
#!/bin/bash
service network stop
#延遲300秒後在執行啓動網卡的操作
sleep 800
service network start
echo "hello,world!"
Linux命令
service network stop/start 關閉 or 啓動
service network restart 重啓
rz 命令工具安裝命令
yum -y install lrzsz
shell文件執行步驟:
1、將腳本上傳到服務器(cd 到相應目錄)
2、chmod +x ./test.sh #使腳本具有執行權限
3、./test.sh #執行腳本