From 39058432570246a4c7d4cbe2e3575cfb0d30f678 Mon Sep 17 00:00:00 2001 From: Brian O'Connor <bocon13@gmail.com> Date: Mon, 9 Sep 2013 19:21:56 -0700 Subject: [PATCH] accept command line args in baresshd.py --- examples/baresshd.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/baresshd.py b/examples/baresshd.py index a714edbe..081a8121 100755 --- a/examples/baresshd.py +++ b/examples/baresshd.py @@ -2,6 +2,7 @@ "This example doesn't use OpenFlow, but attempts to run sshd in a namespace." +import sys from mininet.node import Host from mininet.util import ensureRoot @@ -27,6 +28,10 @@ f.close() print "*** Running sshd" -h1.cmd( '/usr/sbin/sshd -o "Banner /tmp/%s.banner"' % h1.name ) +cmd = '/usr/sbin/sshd -o "Banner /tmp/%s.banner"' % h1.name +# add arguments from the command line +if len( sys.argv ) > 1: + cmd += ' ' + ' '.join( sys.argv[ 1: ] ) +h1.cmd( cmd ) print "*** You may now ssh into", h1.name, "at", h1.IP() -- GitLab