Created
August 22, 2018 02:02
-
-
Save weiofcn/8f9d7ef4b2d601797d42f2f61a500144 to your computer and use it in GitHub Desktop.
Revisions
-
weiofcn created this gist
Aug 22, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ ```shell Sub Main xsh.Screen.Send("export update_dir=/root/zhouwei/") xsh.Screen.Send(VbCr) xsh.Screen.Send("cd /data && rm -rf `date +%Y%m%d` && cd $update_dir && rm * -rf") xsh.Screen.Send(VbCr) xsh.Screen.Send("scp [email protected]:/root/soc_env/CloudSocEnv*.tar.gz .") xsh.Screen.Send(VbCr) xsh.Screen.WaitForString "[email protected]'s password:" xsh.Screen.Send("kenchow") xsh.Screen.Send(VbCr) xsh.Session.Sleep 3000 xsh.Screen.Send("scp [email protected]:/root/soc/CloudSOC*.tar.gz .") xsh.Screen.Send(VbCr) xsh.Screen.WaitForString "[email protected]'s password:" xsh.Screen.Send("kenchow") xsh.Screen.Send(VbCr) xsh.Session.Sleep 3000 xsh.Screen.Send("ls *.tar.gz | xargs -n1 tar xzvf") xsh.Screen.Send(VbCr) xsh.Session.Sleep 1000 xsh.Screen.Send("cd /virus && rm -Rf */ && cd $update_dir") xsh.Screen.Send(VbCr) xsh.Screen.Send("cd `ls -d */ | tail -1` && cd update && sh update.sh") xsh.Screen.Send(VbCr) xsh.Session.Sleep 1000 xsh.Screen.Send("cd ../.. && cd `ls -d */ | head -1` && cd update && sh update.sh") xsh.Screen.Send(VbCr) xsh.Session.Sleep 1000 xsh.Screen.Send("cd $update_dir && ps -ef | grep python") xsh.Screen.Send(VbCr) End Sub ````