You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
971 B
Java
54 lines
971 B
Java
import org.apache.log4j.Logger;
|
|
|
|
public class SshCurl {
|
|
|
|
public static final Logger logger = Logger.getLogger(SshSh.class);
|
|
|
|
private static String targetSys = "";
|
|
|
|
|
|
public static void main(String[] args) {
|
|
if(args.length != 1) {
|
|
System.err.println("총 1개의 args를 입력하지 않았습니다.");
|
|
System.exit(0);
|
|
return;
|
|
}
|
|
|
|
targetSys = args[0];
|
|
|
|
SshCurl self = new SshCurl();
|
|
|
|
try {
|
|
self.run();
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
private void run() throws Exception {
|
|
|
|
FTPUtil ssh = new FTPUtil();
|
|
ssh.initExec("175.193.201.56", "tmax","tmax1234", 10040);
|
|
|
|
try {
|
|
String cmd = "";
|
|
String cmdPrefix = "curl -X GET http://175.193.201.146:92/relay/touch?sys=";
|
|
if(targetSys.equals("monitoring")) {
|
|
cmd = cmdPrefix+"monitoring";
|
|
} else {
|
|
|
|
}
|
|
|
|
if(!cmd.equals("")) {
|
|
ssh.setCommand(cmd);
|
|
}
|
|
|
|
ssh.disconnectExec();
|
|
} catch (Exception e) {
|
|
|
|
}
|
|
|
|
return;
|
|
}
|
|
}
|