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)