Updating DDoSProtectionSwitcher switchServer() method to launch remote script for IP change instead of local.

This commit is contained in:
Peter Miller 2014-09-27 00:45:52 -04:00
parent 895878ee40
commit 1bf5debc06

View File

@ -275,10 +275,13 @@ public class DDoSProtectionSwitcher
private static void switchServer(final String privateIp, String currentIp, String newIp, String currentGateway, private static void switchServer(final String privateIp, String currentIp, String newIp, String currentGateway,
String newGateway) 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, ProcessRunner pr = new ProcessRunner(new String[] { cmd, args, remoteCmd, currentIp, newIp,
currentGateway, newGateway }); currentGateway, newGateway, remoteCmdEnd });
pr.start(new GenericRunnable<Boolean>() pr.start(new GenericRunnable<Boolean>()
{ {
public void run(Boolean error) public void run(Boolean error)