blob: feb9973feb9efefdf0f29be183a7f67ba8b9bba2 [file] [log] [blame]
Thomas Vachuska0fdf7c92016-05-05 17:01:39 -07001#!/bin/bash
2# Destroys an LXC cell with the specified name.
3
4name=$1
Thomas Vachuska5420ba32016-05-13 14:45:25 -04005spec=$2
6
7nodes=${spec%+*}
8mininet=${spec#*+}
Thomas Vachuska0fdf7c92016-05-05 17:01:39 -07009
10cd $(dirname $0)
11
Thomas Vachuska5420ba32016-05-13 14:45:25 -040012if [ $mininet -ge 1 ]; then
13 ./destroy-node $name-n
14fi
Thomas Vachuska0fdf7c92016-05-05 17:01:39 -070015
Thomas Vachuska5420ba32016-05-13 14:45:25 -040016let n=1
17while [ $n -le $nodes ]; do
Thomas Vachuska0fdf7c92016-05-05 17:01:39 -070018 ./destroy-node $name-$n
Thomas Vachuska5420ba32016-05-13 14:45:25 -040019 let n=n+1
Thomas Vachuska0fdf7c92016-05-05 17:01:39 -070020done