Implement single host as argument
This commit is contained in:
parent
1531dc3b28
commit
cdc4dfa13b
@ -1,6 +1,7 @@
|
|||||||
#!/bin/python
|
#!/bin/python
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
ssh_config = os.path.expanduser('~') + "/.ssh/config"
|
ssh_config = os.path.expanduser('~') + "/.ssh/config"
|
||||||
@ -10,6 +11,14 @@ with open(ssh_config) as file:
|
|||||||
|
|
||||||
#ping -c 1 -w 1
|
#ping -c 1 -w 1
|
||||||
|
|
||||||
|
if sys.argv[1] != None:
|
||||||
|
ssh_host = sys.argv[1]
|
||||||
|
command = f"infocmp | ssh {ssh_host} 'tic -x /dev/stdin'"
|
||||||
|
return_value = subprocess.call(command, shell=True, stdout=open(os.devnull, "w"), stderr=subprocess.STDOUT)
|
||||||
|
if return_value == 1:
|
||||||
|
print(f"Could not send terminfo to {ssh_host}")
|
||||||
|
|
||||||
|
else:
|
||||||
for l in file_content:
|
for l in file_content:
|
||||||
if "host " in l:
|
if "host " in l:
|
||||||
l_index = file_content.index(l)
|
l_index = file_content.index(l)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user