Thomas Vachuska | 0fdf7c9 | 2016-05-05 17:01:39 -0700 | [diff] [blame] | 1 | #!/bin/bash |
2 | # Destroys an LXC cell with the specified name. | ||||
3 | |||||
4 | name=$1 | ||||
Thomas Vachuska | 5420ba3 | 2016-05-13 14:45:25 -0400 | [diff] [blame] | 5 | spec=$2 |
6 | |||||
7 | nodes=${spec%+*} | ||||
8 | mininet=${spec#*+} | ||||
Thomas Vachuska | 0fdf7c9 | 2016-05-05 17:01:39 -0700 | [diff] [blame] | 9 | |
10 | cd $(dirname $0) | ||||
11 | |||||
Thomas Vachuska | 5420ba3 | 2016-05-13 14:45:25 -0400 | [diff] [blame] | 12 | if [ $mininet -ge 1 ]; then |
13 | ./destroy-node $name-n | ||||
14 | fi | ||||
Thomas Vachuska | 0fdf7c9 | 2016-05-05 17:01:39 -0700 | [diff] [blame] | 15 | |
Thomas Vachuska | 5420ba3 | 2016-05-13 14:45:25 -0400 | [diff] [blame] | 16 | let n=1 |
17 | while [ $n -le $nodes ]; do | ||||
Thomas Vachuska | 0fdf7c9 | 2016-05-05 17:01:39 -0700 | [diff] [blame] | 18 | ./destroy-node $name-$n |
Thomas Vachuska | 5420ba3 | 2016-05-13 14:45:25 -0400 | [diff] [blame] | 19 | let n=n+1 |
Thomas Vachuska | 0fdf7c9 | 2016-05-05 17:01:39 -0700 | [diff] [blame] | 20 | done |