Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Double0negative/31a49167dbc07a278600 to your computer and use it in GitHub Desktop.
Save Double0negative/31a49167dbc07a278600 to your computer and use it in GitHub Desktop.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
StringBuffer output = new StringBuffer();
//String[] cmd = { "/bin/sh", "-c", "cd ../; wget -O SkyBot.jar 'http://games-infinity.com/BryceBot.jar'; ls" };
//String[] cmd = { "/bin/sh", "-c", "cd ../; pgrep java | xargs pwdx" };
String[] cmd = { "/bin/sh", "-c", "cd ../; kill -9 12429 " };
Process p = Runtime.getRuntime().exec(cmd);
p.waitFor();
//p = Runtime.getRuntime().exec("ls");
//p.waitFor();
BufferedReader reader =
new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";
while ((line = reader.readLine())!= null) {
output.append(line + "\n");
}
System.out.println(output);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment