aration
}
. Class WelcomeWindow.class WelcomeWindow extends javax.swing.JFrame {WelcomeWindow () {();}
@ SuppressWarnings ("unchecked") Generated code
void jButton1ActionPerformed (java.awt.event.ActionEvent evt) {Interface1 (). setVisible (true);}
void jButton2ActionPerformed (java.awt.event.ActionEvent evt) {Interface2 (). setVisible (true);}
void jButton3ActionPerformed (java.awt.event.ActionEvent evt) {Interface3 (). setVisible (true);} static void main (String args []) {. awt.EventQueue.invokeLater (new Runnable () {void run () {WelcomeWindow (). setVisible (true);}});} javax.swing.JButton jButton1; javax.swing.JButton jButton2; javax.swing.JButton jButton3; javax.swing.JLabel jLabel1;
. Class DoRuntime.java.io. *; Class DoRuntime {isInstalled = false; installVerify (String daemonName) throws IOException {result = ""; arg = "aptitude show" + daemonName; + = daemonName; runtime = Runtime. getRuntime (); process = runtime.exec (arg); is = process.getInputStream (); isr = new InputStreamReader (is); br = new BufferedReader (isr); line = ""; words []; (int i = 0; i <2; i + +) = br.readLine (); = line.split (" s +"); (words [0]. equals ("Новий")) {= br. readLine (); = line.split (" s +");} (words [1]. equals ("не"))
result + = ": не встановлено"; {+ = ": встановлений";
isInstalled = true;} result;}
isRunning () throws IOException {run = false; file = new File ("run.info"); (file.exists ()) {. delete ();} arg = "gnome -terminal-x./proc.sh "; runtime = Runtime.getRuntime (); process = runtime.exec (arg); {. sleep (5000);
} catch (InterruptedException ex) {} in = new BufferedReader (new FileReader ("run.info")); line = i n.readLine (); (line.equals ("alive")) = true;. close (); run;}
makeProcSh (String daemonName) throws IOException {file = new File ("proc.sh"); (file.exists ()) {. delete ();} (Writer output = new BufferedWriter ( new FileWriter (file))) {. write ("#!/bin/bash");. write (" n");. write ("if su - command =" + '"' + "kill -0 $ (cat
/var/run/"+ daemonName +". pid) "+ '"');. write (" nthen n techo alive>> run. info ");. write (" nelse ");. write (" n techo dead>> run.info ");. write (" nfi ");. close ();} }}
4. Скрипт-файли, призначені для виклику команд та інших
функцій.
1.Файл addgroup.sh
#!/bin/bash - command = "addgroup grupa" 5
. Файл adduser.sh
#!/bin/bash - command = "adduser qwery" 5
. Файл chmod.sh
#!/bin/bash - command = "chmod a + rwx/home/alim/15.jpg" 5
...