public String getColumnName(int columnIndex) { if (columnIndex == 0) { return ControlMain.getProperty("name"); } else if (columnIndex == 1) { return ControlMain.getProperty("searchInEpg"); } else if (columnIndex == 2) { return ControlMain.getProperty("searchinMG"); } else if (columnIndex == 3) { return ControlMain.getProperty("searchOnlyTitle"); } return ControlMain.getProperty("buildTimer"); }
private static void createTelnetSession(String command) throws IOException, InterruptedException { telnet.connect(ControlMain.getActiveBox().getDboxIp()); OutputStream ostream = telnet.getOutputStream(); Writer writer = new OutputStreamWriter(ostream); writer.write(ControlMain.getActiveBox().getLogin() + "\n"); writer.flush(); Thread.sleep(1000); writer.write(ControlMain.getActiveBox().getPassword() + "\n"); writer.flush(); Thread.sleep(1000); writer.write(command + "\n"); writer.flush(); closeTelnetSession(); }
public static void runReboot() throws IOException, InterruptedException { Logger.getLogger("SerBoxTelnet").info(ControlMain.getProperty("msg_reboot")); telnet.connect(ControlMain.getActiveBox().getDboxIp()); OutputStream ostream = telnet.getOutputStream(); Writer writer = new OutputStreamWriter(ostream); writer.write(ControlMain.getActiveBox().getLogin() + "\n"); writer.flush(); Thread.sleep(1000); writer.write(ControlMain.getActiveBox().getPassword() + "\n"); writer.flush(); Thread.sleep(1000); writer.write("killall sectionsd" + "\n"); writer.flush(); Thread.sleep(1000); writer.write("killall camd2" + "\n"); writer.flush(); Thread.sleep(1000); writer.write("killall timerd" + "\n"); writer.flush(); Thread.sleep(1000); writer.write("killall timerd" + "\n"); writer.flush(); Thread.sleep(1000); writer.write("killall zapit" + "\n"); writer.flush(); Thread.sleep(1000); writer.write("killall controld" + "\n"); writer.flush(); Thread.sleep(1000); writer.write("killall nhttpd" + "\n"); writer.flush(); Thread.sleep(1000); writer.write("sleep 3" + "\n"); writer.flush(); Thread.sleep(1000); writer.write("busybox -reboot" + "\n"); writer.flush(); Thread.sleep(1000); closeTelnetSession(); }
public static void runHalt() throws IOException, InterruptedException { Logger.getLogger("SerBoxTelnet").info(ControlMain.getProperty("msg_reboot")); createTelnetSession("halt"); }
public static void runSectiondReset() throws IOException, InterruptedException { Logger.getLogger("SerBoxTelnet").info(ControlMain.getProperty("msg_sectiond")); createTelnetSession("killall sectionsd && sectionsd"); }
public static void disableSPTSMode() throws IOException, InterruptedException { Logger.getLogger("SerBoxTelnet").info(ControlMain.getProperty("msg_DisableSPTS")); createTelnetSession("rm -f /var/etc/.spts_mode"); runReboot(); }