mirror of
https://github.com/KrystianD/mikrotik_configurator.git
synced 2025-06-23 19:11:41 +02:00
added support for passing ssh port in --override-ip option
This commit is contained in:
parent
fc1fafad4c
commit
65789a281a
@ -28,9 +28,14 @@ def main():
|
|||||||
host = cfg["host"]
|
host = cfg["host"]
|
||||||
has_flash = cfg.get("has_flash", False)
|
has_flash = cfg.get("has_flash", False)
|
||||||
|
|
||||||
|
ssh_port = 22
|
||||||
if args.override_ip is not None:
|
if args.override_ip is not None:
|
||||||
host = args.override_ip
|
host = args.override_ip
|
||||||
|
|
||||||
|
if ":" in host:
|
||||||
|
host, ssh_port_str = host.split(":", 1)
|
||||||
|
ssh_port = int(ssh_port_str)
|
||||||
|
|
||||||
files = args.files
|
files = args.files
|
||||||
|
|
||||||
orders = [float(os.path.basename(x).split("-")[0].replace("_", ".")) for x in files]
|
orders = [float(os.path.basename(x).split("-")[0].replace("_", ".")) for x in files]
|
||||||
@ -73,6 +78,7 @@ def main():
|
|||||||
|
|
||||||
cargs = [
|
cargs = [
|
||||||
"scp",
|
"scp",
|
||||||
|
"-P", str(ssh_port),
|
||||||
"-o", "StrictHostKeyChecking=false",
|
"-o", "StrictHostKeyChecking=false",
|
||||||
"-o", "UserKnownHostsFile=/dev/null",
|
"-o", "UserKnownHostsFile=/dev/null",
|
||||||
"-o", "PubkeyAcceptedKeyTypes=+ssh-rsa",
|
"-o", "PubkeyAcceptedKeyTypes=+ssh-rsa",
|
||||||
@ -91,6 +97,7 @@ def main():
|
|||||||
cmd = f"/import file={base_path}{script_name}"
|
cmd = f"/import file={base_path}{script_name}"
|
||||||
cargs = [
|
cargs = [
|
||||||
"ssh",
|
"ssh",
|
||||||
|
"-p", str(ssh_port),
|
||||||
"-o", "StrictHostKeyChecking=false",
|
"-o", "StrictHostKeyChecking=false",
|
||||||
"-o", "UserKnownHostsFile=/dev/null",
|
"-o", "UserKnownHostsFile=/dev/null",
|
||||||
"-o", "PubkeyAcceptedKeyTypes=+ssh-rsa",
|
"-o", "PubkeyAcceptedKeyTypes=+ssh-rsa",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user