Last active
December 17, 2015 10:49
-
-
Save cnsoft/5597375 to your computer and use it in GitHub Desktop.
Auto Start or Shutdown Testing Server
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 characters
child = pexpect.spawn('su 3028') | |
child.expect(".word") | |
child.sendline("3028") | |
child.expect(".$") | |
child.sendline('cd ~') | |
child.sendline('/home/exe/mf204/bigworld/tools/server/control_cluster.py check') | |
r = child.expect([".not run",".run",pexpect.EOF]) | |
if r == 0: | |
child.sendline('/home/exe/mf204/bigworld/tools/server/control_cluster.py load simple') | |
print 'try load server' | |
child.expect('.baseappmgr.') | |
else: | |
child.sendline('/home/exe/mf204/bigworld/tools/server/control_cluster.py stop') | |
print 'try stop server' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment