Initial Commit
This commit is contained in:
commit
05c2e5e81f
17 changed files with 1197 additions and 0 deletions
29
ah_tools/vm-remote-ssh.py
Normal file
29
ah_tools/vm-remote-ssh.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import subprocess
|
||||
|
||||
|
||||
def find_server(server):
|
||||
servers = [
|
||||
{"name":"wp", "hostname":"wp-04.ace-hosting.com", "user":"root", "port":22, "identity":""},
|
||||
]
|
||||
|
||||
return servers[server]
|
||||
|
||||
def virtualmin_ssh(server, command):
|
||||
if server["user"] != "root":
|
||||
cmd = "sudo " + cmd
|
||||
|
||||
cmd = f"ssh -p {port} {user}@{hostname} {cmd}"
|
||||
|
||||
result = subprocess.check_output(cmd, shell=True, universal_newlines=True)
|
||||
|
||||
return result
|
||||
|
||||
def get_dns(server, domain):
|
||||
pass
|
||||
|
||||
def main():
|
||||
server = find_server("wp-04")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue