diff --git a/osiris_node.py b/osiris_node.py index 818e48e..bd471f0 100644 --- a/osiris_node.py +++ b/osiris_node.py @@ -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():