Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # http://scratch-tales.blogspot.ru/
- #!/usr/local/bin/python2.7
- import subprocess
- #---------VAR------------
- ps_out = []
- check_result = 0
- #-----------------------
- check_tonel = subprocess.Popen('ps -ax | grep ssh', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- retval = check_tonel.wait()
- for line in check_tonel.stdout.readlines():
- check_result = 1
- if check_result == 0:
- tonel_revive = subprocess.Popen('/usr/bin/ssh -fNg -L 3310:127.0.0.1:3306 [email protected] -p371', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- retval = tonel_revive.wait()
Advertisement
Add Comment
Please, Sign In to add comment