コード例 #1
0
 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");
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 public static void runHalt() throws IOException, InterruptedException {
   Logger.getLogger("SerBoxTelnet").info(ControlMain.getProperty("msg_reboot"));
   createTelnetSession("halt");
 }
コード例 #5
0
 public static void runSectiondReset() throws IOException, InterruptedException {
   Logger.getLogger("SerBoxTelnet").info(ControlMain.getProperty("msg_sectiond"));
   createTelnetSession("killall sectionsd && sectionsd");
 }
コード例 #6
0
 public static void disableSPTSMode() throws IOException, InterruptedException {
   Logger.getLogger("SerBoxTelnet").info(ControlMain.getProperty("msg_DisableSPTS"));
   createTelnetSession("rm -f /var/etc/.spts_mode");
   runReboot();
 }