Upload files simplify and README file update

This commit is contained in:
rasta5man 2025-08-07 15:52:03 +02:00
parent 7f5697b2a1
commit a9b06d3fb3
4 changed files with 119 additions and 120 deletions

View file

@ -20,29 +20,18 @@ public class CommandExecutor {
public CommandExecutor() {
allServers = new BuildServerArray().getAllServers();
timeBetweenCommands = 1; // in seconds (if rebooting, put cca 20 seconds between reboots)
// commandsToExecute = "sudo journalctl --vacuum-size=1M";
// commandsToExecute = "sudo service nodejs restart";
// commandsToExecute = "rm -rf /home/unipi/flowserver/flow";
// commandsToExecute = "mkdir -p /home/unipi/flowserver/flow/helper";
timeBetweenCommands = 30; // in seconds (if rebooting, put cca 20 seconds between reboots)
commandsToExecute = "sudo journalctl --vacuum-size=1M";
commandsToExecute = "sudo service nodejs restart";
commandsToExecute = "python /root/flowserver/addSwitch.py";
commandsToExecute = "python3 /home/unipi/flowserver/addSwitch.py";
commandsToExecute = "sudo service nodejs stop";
commandsToExecute = "tail -n 3 flowserver/monitor.txt";
// commandsToExecute = "sudo reboot";
commandsToExecute = "tail -n 10 flowserver/monitor.txt";
commandsToExecute = "sudo reboot";
// commandsToExecute = "ls -l /home/unipi/flowserver/databases";
// commandsToExecute = "ls -l /root/flowserver/databases";
// commandsToExecute = "rm /home/unipi/flowserver/databases/1.tbdata.nosql /home/unipi/flowserver/databases/2.tbdata.nosql /home/unipi/flowserver/databases/3.tbdata.nosql /home/unipi/flowserver/databases/4.tbdata.nosql /home/unipi/flowserver/databases/5.tbdata.nosql /home/unipi/flowserver/databases/6.tbdata.nosql /home/unipi/flowserver/databases/7.tbdata.nosql /home/unipi/flowserver/databases/8.tbdata.nosql /home/unipi/flowserver/databases/9.tbdata.nosql /home/unipi/flowserver/databases/10.tbdata.nosql";
// commandsToExecute = "head -n 1 /home/unipi/flowserver/databases/nodes_original/nodes_original.table";
// commandsToExecute = "sudo sh -c 'chmod 777 /etc/owfs.conf; chmod 777 /etc/fuse.conf; chmod 777 /etc/evok.conf; chmod 777 /lib/systemd/system/owfs.service; mkdir /mnt/1wire'";
// commandsToExecute = "sudo sh -c 'service owfs stop; service evok stop; service nodejs stop; chmod 777 /etc/owfs.conf; chmod 777 /etc/fuse.conf; chmod 777 /etc/evok.conf; chmod 777 /lib/systemd/system/owfs.service; mkdir /mnt/1wire'";
// commandsToExecute = "sudo sh -c 'chmod 644 /etc/owfs.conf; chmod 644 /etc/fuse.conf; chmod 644 /etc/evok.conf; chmod 644 /lib/systemd/system/owfs.service'";
// commandsToExecute = "python /home/unipi/flowserver/cloud_topic.py && rm /home/unipi/flowserver/databases/status.table";
// commandsToExecute = "ls -l /root/flowserver/databases";
}
public void open(String username, String hostname, String password) throws JSchException {
JSch jSch = new JSch();
@ -53,8 +42,9 @@ public class CommandExecutor {
// Properties config = new Properties();
//config.put("StrictHostKeyChecking", "no"); // not recommended
//session.setConfig("StrictHostKeyChecking", "no"); // not recommended
//session.setConfig("PreferredAuthentications", "password");
// session.setConfig("PreferredAuthentications", "password");
//session.setConfig(config);
//session.setConfig("PreferredAuthentications", "password,keyboard-interactive");
session.setPassword(password);
System.out.println("Connecting SSH to " + hostname + " - Please wait for few seconds... ");