no message
parent
907be1709e
commit
0ff49401b7
@ -0,0 +1,53 @@
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public class SshTouch {
|
||||
|
||||
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];
|
||||
|
||||
SshTouch self = new SshTouch();
|
||||
|
||||
try {
|
||||
self.run();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void run() throws Exception {
|
||||
|
||||
FTPUtil ssh = new FTPUtil();
|
||||
ssh.initExec("162.168.201.120", "tcs", "tcs", 22);
|
||||
|
||||
try {
|
||||
String cmd = "";
|
||||
String cmdPrefix = "touch /home/tcs/touch/ ";
|
||||
if(targetSys.equals("monitoring")) {
|
||||
cmd = cmdPrefix+"monitoring";
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if(!cmd.equals("")) {
|
||||
ssh.setCommand(cmd);
|
||||
}
|
||||
|
||||
ssh.disconnectExec();
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/expect -f
|
||||
if [ $# -lt 1]
|
||||
then
|
||||
echo "I Hope your input. [TARGET_SYS]"
|
||||
exit
|
||||
fi
|
||||
|
||||
TARGET_SYS=$1
|
||||
|
||||
java -jar /gpta/source-web/cfs/relay/ssh-touch.jar $TARGET_SYS &
|
||||
Loading…
Reference in New Issue