]> git.entuzijast.net Git - imunes.git/commitdiff
prebacio OS-specific application start funkcije u appstart.tcl
authorJosip Rodin <joy@numa-ubuntu-vm.(none)>
Sun, 13 Sep 2009 12:30:29 +0000 (14:30 +0200)
committerJosip Rodin <joy@numa-ubuntu-vm.(none)>
Sun, 13 Sep 2009 12:30:29 +0000 (14:30 +0200)
appstart.tcl [new file with mode: 0644]
editor.tcl
imunes.tcl
install.sh
linux/appstart.tcl [new file with mode: 0644]

diff --git a/appstart.tcl b/appstart.tcl
new file mode 100644 (file)
index 0000000..f78f3b1
--- /dev/null
@@ -0,0 +1,74 @@
+#****f* appstart.tcl/spawnShell
+# NAME
+#   spawnShell -- spawn shell
+# SYNOPSIS
+#   spawnShell $node $cmd
+# FUNCTION
+#   This procedure spawns a new shell for a specified node.
+#   The shell is specified in cmd parameter.
+# INPUTS
+#   * node -- node id of the node for which the shell 
+#   is spawned.
+#   * cmd -- the path to the shell.
+#****
+proc spawnShell { node cmd } {
+    upvar 0 ::cf::[set ::curcfg]::eid eid
+    global remote_exec exec_host gui_unix
+
+    set node_id $eid\.$node
+
+    if { $remote_exec } {
+       nexec vimageShellServer.sh $node_id 1234 $cmd &
+       if { $gui_unix } {
+           exec xterm -sb -rightbar \
+               -T "IMUNES: [getNodeName $node] (console)" \
+               -e "nc $exec_host 1234" &
+       } else {
+           exec cmd /c nc $exec_host 1234 &
+       }
+    } else {
+       nexec xterm -sb -rightbar \
+           -T "IMUNES: [getNodeName $node] (console)" \
+           -e "vimage $node_id $cmd" &
+    }
+}
+
+
+#****f* appstart.tcl/startethereal
+# NAME
+#   startethereal -- start ethereal
+# SYNOPSIS
+#   startethereal $node $iface
+# FUNCTION
+#   This procedure starts ethereal for the specified node
+#   and the specified interface.
+# INPUTS
+#   * node -- node id
+#   * iface -- interface name
+#****
+proc startethereal { node iface } {
+    upvar 0 ::cf::[set ::curcfg]::eid eid
+
+    set interface "$iface@$eid\.$node"
+    nexec wireshark -i $interface -f " " &
+}
+
+
+#****f* appstart.tcl/startopera
+# NAME
+#   startopera -- start opera
+# SYNOPSIS
+#   startopera $node
+# FUNCTION
+#   This procedure starts opera on the specified node
+# INPUTS
+#   * node -- node id
+#   * iface -- interface name
+#****
+proc startopera { node } {
+    upvar 0 ::cf::[set ::curcfg]::eid eid
+
+    # set interface "$iface@$eid\.$node"
+    nexec startopera $eid.$node &
+}
+
index f3e2adeea92962e1023db57fb5e1d7b4a1a382ac..5a5aec8211cea7ef9c3d20ac0db4a5863dd5c4c9 100755 (executable)
@@ -1275,97 +1275,6 @@ proc button3node { c x y } {
 }
 
 
-#****f* editor.tcl/spawnShell
-# NAME
-#   spawnShell -- spawn shell
-# SYNOPSIS
-#   spawnShell $node $cmd
-# FUNCTION
-#   This procedure spawns a new shell for a specified node.
-#   The shell is specified in cmd parameter.
-# INPUTS
-#   * node -- node id of the node for which the shell 
-#   is spawned.
-#   * cmd -- the path to the shell.
-#****
-proc spawnShell { node cmd } {
-    upvar 0 ::cf::[set ::curcfg]::eid eid
-    global remote_exec exec_host gui_unix gui_freebsd gui_linux
-
-    set node_id $eid\.$node
-
-    if { $remote_exec } {
-       nexec vimageShellServer.sh $node_id 1234 $cmd &
-       if { $gui_unix } {
-           exec xterm -sb -rightbar \
-               -T "IMUNES: [getNodeName $node] (console)" \
-               -e "nc $exec_host 1234" &
-       } else {
-           exec cmd /c nc $exec_host 1234 &
-       }
-    } else {
-        if { $gui_freebsd } {
-               set shellcommand "vimage $node_id $cmd"
-       } elseif { $gui_linux } {
-           if { $cmd == "enter" } {
-                   set shellcommand "vzctl enter $node"
-               } else {
-                   set shellcommand "vzctl exec $node $cmd"
-            }
-       }
-       nexec xterm -sb -rightbar \
-                   -T "IMUNES: [getNodeName $node] (console)" \
-               -e "$shellcommand" &
-    }
-}
-
-
-#****f* editor.tcl/startethereal
-# NAME
-#   startethereal -- start ethereal
-# SYNOPSIS
-#   startethereal $node $iface
-# FUNCTION
-#   This procedure starts ethereal for the specified node
-#   and the specified interface.
-# INPUTS
-#   * node -- node id
-#   * iface -- interface name
-#****
-proc startethereal { node iface } {
-    upvar 0 ::cf::[set ::curcfg]::eid eid
-    global gui_unix gui_linux
-    
-    #OpenVZ - lokalni interface-i za VE-ve, imaju drukciju nomenklaturu
-    if { $gui_unix && $gui_linux } {
-        set interface "to_[set node]_[set iface]"
-    } else {
-        set interface "$iface@$eid\.$node"
-    }
-    
-    nexec wireshark -i $interface -f " " &
-}
-
-
-#****f* editor.tcl/startopera
-# NAME
-#   startopera -- start opera
-# SYNOPSIS
-#   startopera $node
-# FUNCTION
-#   This procedure starts opera on the specified node
-# INPUTS
-#   * node -- node id
-#   * iface -- interface name
-#****
-proc startopera { node } {
-    upvar 0 ::cf::[set ::curcfg]::eid eid
-
-    # set interface "$iface@$eid\.$node"
-    nexec startopera $eid.$node &
-}
-
-
 #****f* editor.tcl/button1
 # NAME
 #   button1
index 308ae6ae95123fecf197d87e68d11b4bd138170b..29a33772b54e542d1f67103a4f9a2e9b25c767c8 100755 (executable)
@@ -166,6 +166,13 @@ if { $gui_unix && $gui_linux } {
 }
 
 source "$ROOTDIR/$LIBDIR/editor.tcl"
+
+if { $gui_unix && $gui_linux } {
+    source "$ROOTDIR/$LIBDIR/linux/appstart.tcl"
+} else {
+    source "$ROOTDIR/$LIBDIR/appstart.tcl"
+}
+
 source "$ROOTDIR/$LIBDIR/copypaste.tcl"
 source "$ROOTDIR/$LIBDIR/annotations.tcl"
 
index f38cacc38f865ed3b08348077653164bd526d3cb..924a96c200d6ca8c6c92443f046ab8e4bb58a2a9 100755 (executable)
@@ -23,7 +23,7 @@ sed -e "s,LIBDIR=\"\",LIBDIR=$LIBDIR," \
 chmod 755 $ROOTDIR/$BINDIR/imunes
 
 lib_files="nodecfg.tcl linkcfg.tcl cfgparse.tcl ipv4.tcl ipv6.tcl exec.tcl \
-          canvas.tcl editor.tcl filemgmt.tcl help.tcl initgui.tcl \
+          canvas.tcl editor.tcl appstart.tcl filemgmt.tcl help.tcl initgui.tcl \
           copypaste.tcl quagga.tcl xorp.tcl static.tcl pc.tcl host.tcl \
           lanswitch.tcl rj45.tcl hub.tcl ns2imunes.tcl ipsec.tcl \
           topogen.tcl annotations.tcl gpgui.tcl graph_partitioning.tcl \
diff --git a/linux/appstart.tcl b/linux/appstart.tcl
new file mode 100644 (file)
index 0000000..3666e01
--- /dev/null
@@ -0,0 +1,91 @@
+#****f* appstart.tcl/spawnShell
+# NAME
+#   spawnShell -- spawn shell
+# SYNOPSIS
+#   spawnShell $node $cmd
+# FUNCTION
+#   This procedure spawns a new shell for a specified node.
+#   The shell is specified in cmd parameter.
+# INPUTS
+#   * node -- node id of the node for which the shell 
+#   is spawned.
+#   * cmd -- the path to the shell.
+#****
+proc spawnShell { node cmd } {
+    upvar 0 ::cf::[set ::curcfg]::eid eid
+    global remote_exec exec_host gui_unix gui_freebsd gui_linux
+
+    set node_id $eid\.$node
+
+    if { $remote_exec } {
+       nexec vimageShellServer.sh $node_id 1234 $cmd &
+       if { $gui_unix } {
+           exec xterm -sb -rightbar \
+               -T "IMUNES: [getNodeName $node] (console)" \
+               -e "nc $exec_host 1234" &
+       } else {
+           exec cmd /c nc $exec_host 1234 &
+       }
+    } else {
+        if { $gui_freebsd } {
+               set shellcommand "vimage $node_id $cmd"
+       } elseif { $gui_linux } {
+           if { $cmd == "enter" } {
+                   set shellcommand "vzctl enter $node"
+               } else {
+                   set shellcommand "vzctl exec $node $cmd"
+            }
+       }
+       nexec xterm -sb -rightbar \
+                   -T "IMUNES: [getNodeName $node] (console)" \
+               -e "$shellcommand" &
+    }
+}
+
+
+
+#****f* appstart.tcl/startethereal
+# NAME
+#   startethereal -- start ethereal
+# SYNOPSIS
+#   startethereal $node $iface
+# FUNCTION
+#   This procedure starts ethereal for the specified node
+#   and the specified interface.
+# INPUTS
+#   * node -- node id
+#   * iface -- interface name
+#****
+proc startethereal { node iface } {
+    upvar 0 ::cf::[set ::curcfg]::eid eid
+    global gui_unix gui_linux
+    
+    #OpenVZ - lokalni interface-i za VE-ve, imaju drukciju nomenklaturu
+    if { $gui_unix && $gui_linux } {
+        set interface "to_[set node]_[set iface]"
+    } else {
+        set interface "$iface@$eid\.$node"
+    }
+    
+    nexec wireshark -i $interface -f " " &
+}
+
+
+#****f* appstart.tcl/startopera
+# NAME
+#   startopera -- start opera
+# SYNOPSIS
+#   startopera $node
+# FUNCTION
+#   This procedure starts opera on the specified node
+# INPUTS
+#   * node -- node id
+#   * iface -- interface name
+#****
+proc startopera { node } {
+    upvar 0 ::cf::[set ::curcfg]::eid eid
+
+    # set interface "$iface@$eid\.$node"
+    nexec startopera $eid.$node &
+}
+