From 2dedfb97c9121862423ab0fc10bf6a5081315be2 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 5 Dec 2022 12:09:58 +0100 Subject: [rebootcontrol] WOL from Server > WOL from other subnet's client --- modules-available/rebootcontrol/inc/rebootcontrol.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules-available/rebootcontrol') diff --git a/modules-available/rebootcontrol/inc/rebootcontrol.inc.php b/modules-available/rebootcontrol/inc/rebootcontrol.inc.php index 132ff6ff..a37b070c 100644 --- a/modules-available/rebootcontrol/inc/rebootcontrol.inc.php +++ b/modules-available/rebootcontrol/inc/rebootcontrol.inc.php @@ -381,8 +381,6 @@ class RebootControl self::addSshMethodUsingClient($subnet['dclients'], $taskClient['methods'], $taskSsh); // Jumphost - usually in same subnet self::addSshMethodUsingJumphost($subnet['djumphosts'], true, $taskClient['methods'], $taskSsh); - // Use clients in other subnets, known to be able to reach the destination net - self::addSshMethodUsingClient($subnet['iclients'], $taskClient['methods'], $taskSsh); // Jumphosts in other subnets, determined to be able to reach destination subnet self::addSshMethodUsingJumphost($subnet['ijumphosts'], true, $taskClient['methods'], $taskSsh); // If directly reachable from server, prefer this now over the questionable approaches below, @@ -390,11 +388,15 @@ class RebootControl if ($overrideBroadcast === false && $subnet['isdirect']) { $taskClient['methods'][] = 'DIRECT'; } + // Use clients in other subnets, known to be able to reach the destination net + self::addSshMethodUsingClient($subnet['iclients'], $taskClient['methods'], $taskSsh); + // Add warning if nothing works if (empty($taskClient['methods'])) { $unreachable[] = $dbClient; } else { // TODO: Remember WOL was attempted } + // "Questionable approaches": // Last fallback is jumphosts that were not reachable when last checked, this is really a last resort self::addSshMethodUsingJumphost($subnet['djumphosts'], false, $taskClient['methods'], $taskSsh); self::addSshMethodUsingJumphost($subnet['ijumphosts'], false, $taskClient['methods'], $taskSsh); -- cgit v1.2.3-55-g7522