Thomas Vachuska | 0fdf7c9 | 2016-05-05 17:01:39 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Creates a new cell. |
| 3 | |
| 4 | name="$1" |
| 5 | ipx="$2" |
Thomas Vachuska | e91541f | 2016-05-05 23:15:41 -0700 | [diff] [blame] | 6 | shift 2 |
| 7 | key="$@" |
Thomas Vachuska | 0fdf7c9 | 2016-05-05 17:01:39 -0700 | [diff] [blame] | 8 | |
| 9 | cd $(dirname $0) |
| 10 | |
Thomas Vachuska | 9e61bd9 | 2016-05-06 15:34:59 -0700 | [diff] [blame] | 11 | sudo lxc-attach -n bit-proxy -- bash -c "grep -qF \"$key\" /home/sdn/.ssh/authorized_keys || echo $key >> /home/sdn/.ssh/authorized_keys" |
| 12 | |
Thomas Vachuska | e91541f | 2016-05-05 23:15:41 -0700 | [diff] [blame] | 13 | ./clone-node base-mininet ${ipx/x/0} $name-n "$key" |
Thomas Vachuska | 0fdf7c9 | 2016-05-05 17:01:39 -0700 | [diff] [blame] | 14 | |
| 15 | for n in {1..3}; do |
| 16 | ./clone-node base-onos ${ipx/x/$n} $name-$n "$key" |
| 17 | done |