Grandpuits proxy setup

This commit is contained in:
Quentin WEPHRE
2025-10-14 09:58:15 +02:00
parent a994661294
commit 20ec50badf
4 changed files with 15 additions and 17 deletions

View File

@@ -12,14 +12,9 @@ import base64
def execute_command(c, command):
"""Executes a simple command on the remote device."""
# print(f"--- [{c.host}] Executing: {command} ---")
try:
result = c.run(command, hide=True)
return result.stdout
# print("STDOUT:")
# print(result.stdout)
# print("STDERR:")
# print(result.stderr)
except Exception as e:
print(f"Error executing {command}: {e}")
@@ -443,9 +438,9 @@ def write_remote_config_base64_sudo(c, remote_path, content, sudo_pass, user_own
def main():
"""Main function to parse arguments and orchestrate tasks."""
ip_address_prefix = "10.81.35." # Carling subnet
ip_address_range = list(range(68, 75)) # Fronm 65 to 74
ip_address_range.append(85) # Add 85 after 74.
ip_address_prefix = "10.81.60." # Grandpuits subnet
ip_address_range = [ 198, 212 ]#list(range(193, 215)) # Fronm 193 to 214 # TODO: 198, 212
# ip_address_range.append(85) # Add 85 after 74.
hosts = [f"{ip_address_prefix}{suffix}" for suffix in ip_address_range]
ssh_port = 11022
@@ -457,6 +452,8 @@ def main():
connect_args["banner_timeout"] = 3
connect_args["auth_timeout"] = 60
connect_args["channel_timeout"] = 60
connect_args["look_for_keys"] = False
connect_args["allow_agent"] = False
for host in hosts: