From 5b818ad75c1f764a9dfb1fa98d1f36e4edac598e Mon Sep 17 00:00:00 2001 From: Joseph Beshay Date: Mon, 9 Feb 2015 12:55:25 -0600 Subject: [PATCH] Support for running arbitrary command when starting terminal (other than bash) --- mininet/term.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mininet/term.py b/mininet/term.py index 8d838a4..69a3efe 100644 --- a/mininet/term.py +++ b/mininet/term.py @@ -35,7 +35,7 @@ def tunnelX11( node, display=None): "EXEC:'mnexec -a 1 socat STDIO %s'" % connection ] return 'localhost:' + screen, node.popen( cmd ) -def makeTerm( node, title='Node', term='xterm', display=None ): +def makeTerm( node, title='Node', term='xterm', display=None, cmd='bash'): """Create an X11 tunnel to the node and start up a terminal. node: Node object title: base title @@ -54,7 +54,7 @@ def makeTerm( node, title='Node', term='xterm', display=None ): display, tunnel = tunnelX11( node, display ) if display is None: return [] - term = node.popen( cmds[ term ] + [ display, '-e', 'env TERM=ansi bash'] ) + term = node.popen( cmds[ term ] + [ display, '-e', 'env TERM=ansi %s' % cmd ] ) return [ tunnel, term ] if tunnel else [ term ] def runX11( node, cmd ):