From 1bf5debc06f9bb6cdf951a632b55092433c018ab Mon Sep 17 00:00:00 2001 From: Peter Miller Date: Sat, 27 Sep 2014 00:45:52 -0400 Subject: [PATCH] Updating DDoSProtectionSwitcher switchServer() method to launch remote script for IP change instead of local. --- .../src/mineplex/ddos/DDoSProtectionSwitcher.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.DDoSProtectionSwitcher/src/mineplex/ddos/DDoSProtectionSwitcher.java b/Plugins/Mineplex.DDoSProtectionSwitcher/src/mineplex/ddos/DDoSProtectionSwitcher.java index dd9898f6f..9bcaaf2de 100644 --- a/Plugins/Mineplex.DDoSProtectionSwitcher/src/mineplex/ddos/DDoSProtectionSwitcher.java +++ b/Plugins/Mineplex.DDoSProtectionSwitcher/src/mineplex/ddos/DDoSProtectionSwitcher.java @@ -275,10 +275,13 @@ public class DDoSProtectionSwitcher private static void switchServer(final String privateIp, String currentIp, String newIp, String currentGateway, String newGateway) { - String cmd = "/home/mineplex/switchBungeeIp.sh"; + String cmd = "/usr/bin/ssh"; + String args = "-to StrictHostKeyChecking=no -o ServerAliveInterval=10 mineplex@" + privateIp + " -p 5191"; + String remoteCmd = "\"sh /home/mineplex/config/switchBungeeIpRemote.sh"; + String remoteCmdEnd = "\""; - ProcessRunner pr = new ProcessRunner(new String[] { "/bin/sh", cmd, privateIp, currentIp, newIp, - currentGateway, newGateway }); + ProcessRunner pr = new ProcessRunner(new String[] { cmd, args, remoteCmd, currentIp, newIp, + currentGateway, newGateway, remoteCmdEnd }); pr.start(new GenericRunnable() { public void run(Boolean error)