add send start gameservers fn

main
Alex 6 months ago
parent 3205ba0887
commit 22caba9773

@ -52,8 +52,8 @@ def send_wakeonlan(target_host: str):
print(f"Magic packet wurde an {target_host} gesendet")
def _send_command_to_target(target_ip: str, command: str = 'testcommand') -> str:
target_node_route = f'http://{target_ip}:9713/osiris_execute'
def _send_command_to_target(target_ip: str, target_route: str, command: str = 'testcommand') -> str:
target_node_route = f'http://{target_ip}:9713/{target_route}'
response = requests.post(target_node_route, json={'command': command})
result = response.json()
try:
@ -69,14 +69,20 @@ def send_shutdown_command(target_host: str):
print("Shutdown-Command an Ziel-Hostes gesendet.")
ip_profiles = get_target_ips()
ip_target = ip_profiles[target_host]
_send_command_to_target(ip_target,'shutdown')
_send_command_to_target(ip_target,'osiris_execute','shutdown')
def send_testcommand(target_host: str):
print("Test-Command an Ziel-Hostes gesendet.")
ip_profiles = get_target_ips()
ip_target = ip_profiles[target_host]
_send_command_to_target(ip_target)
_send_command_to_target(ip_target, 'osiris_execute')
def send_start_gameservers_minecraft(target_host: str):
print("Start Gameservers Minecraft an Ziel-Hostes gesendet.")
ip_profiles = get_target_ips()
ip_target = ip_profiles[target_host]
_send_command_to_target(ip_target, 'osiris_execute', 'start_gameservers_minecraft')
def process_arguments():

Loading…
Cancel
Save