Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pexpect
- import paramiko
- import sqlite3
- import time
- def runCommands(*someCommands):
- global testid
- ssh = paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- ssh.connect('some.server.example.com', username='root', password='abc123')
- for i in someCommands:
- ssh.exec_command(i)
- logCustom('SSH COMMAND SENT', i)
- return
- runCommands('/etc/init.d/mysqld restart >> mysqld.log 2>&1', \
- '/etc/init.d/httpd restart >> httpd.log 2>&1')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement