sshd.py: allow sshd args to be passed via commandline

This commit is contained in:
Brian O'Connor
2013-09-11 14:45:46 -07:00
parent 9a73dcad53
commit 5a646a0d20
+5 -1
View File
@@ -16,6 +16,8 @@ demonstrates:
- running server processes (sshd in this case) on hosts - running server processes (sshd in this case) on hosts
""" """
import sys
from mininet.net import Mininet from mininet.net import Mininet
from mininet.cli import CLI from mininet.cli import CLI
from mininet.log import lg from mininet.log import lg
@@ -68,4 +70,6 @@ def sshd( network, cmd='/usr/sbin/sshd', opts='-D' ):
if __name__ == '__main__': if __name__ == '__main__':
lg.setLogLevel( 'info') lg.setLogLevel( 'info')
net = TreeNet( depth=1, fanout=4, switch=OVSKernelSwitch ) net = TreeNet( depth=1, fanout=4, switch=OVSKernelSwitch )
sshd( net ) # get sshd args from the command line; default: -D
opts = ' '.join( sys.argv[ 1: ] ) if len( sys.argv ) > 1 else '-D'
sshd( net, opts=opts )