summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/Jsch/scriptExecutor.java
diff options
context:
space:
mode:
authorunknown2014-02-25 11:04:51 +0100
committerunknown2014-02-25 11:04:51 +0100
commit2a3ec0fbda66ed07adcdc968a9365096ecd54f40 (patch)
tree187af202e5a404a15c31f0915e73cb23bf5b7900 /Dozentenmodul/src/Jsch/scriptExecutor.java
parentProblem der herumspringenden Fenster entfernt (diff)
downloadtutor-module-2a3ec0fbda66ed07adcdc968a9365096ecd54f40.tar.gz
tutor-module-2a3ec0fbda66ed07adcdc968a9365096ecd54f40.tar.xz
tutor-module-2a3ec0fbda66ed07adcdc968a9365096ecd54f40.zip
Kommunikation von BwLehrpool Suite zu BwLehrpool Suite Server läuft nun über Thrift
Diffstat (limited to 'Dozentenmodul/src/Jsch/scriptExecutor.java')
-rw-r--r--Dozentenmodul/src/Jsch/scriptExecutor.java61
1 files changed, 0 insertions, 61 deletions
diff --git a/Dozentenmodul/src/Jsch/scriptExecutor.java b/Dozentenmodul/src/Jsch/scriptExecutor.java
deleted file mode 100644
index 0ded43b8..00000000
--- a/Dozentenmodul/src/Jsch/scriptExecutor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package Jsch;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Properties;
-import com.jcraft.jsch.ChannelExec;
-import com.jcraft.jsch.JSch;
-import com.jcraft.jsch.JSchException;
-import com.jcraft.jsch.Session;
-
-public class scriptExecutor {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- executeScript();
- }
-
- public static void executeScript()
- {
- JSch j=new JSch();
-
- try {
- Session se=j.getSession("root", "141.79.128.121", 22);
-
- Properties config = new Properties();
- config.setProperty("StrictHostKeyChecking", "no");
- se.setConfig(config);
- se.setPassword("!N4ye,04u.");
- se.connect();
- ChannelExec ch=(ChannelExec) se.openChannel("exec");
- InputStream is=ch.getInputStream();
-
- ch.setCommand("sh /home/openslx/hello.sh 'test'");
- //ch.setCommand("ls");
- ch.connect();
-
- BufferedReader reader = new BufferedReader(new InputStreamReader(is));
- String line;
- int index = 0;
-
- while ((line = reader.readLine()) != null)
- {
- System.out.println(++index + " : " + line);
- }
-
- ch.disconnect();
- se.disconnect();
-
- System.out.println("Done!");
- } catch (JSchException | IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
-}