summaryrefslogtreecommitdiff
path: root/src/testing/netjail_stop.sh
blob: 689bf7ae98ecc1de50d32e1a341020324775e146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
. "./../testbed/netjail_core.sh"

set -eu
set -x

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

LOCAL_M=$1
GLOBAL_N=$2
NETWORK_NET=$(netjail_print_name "n" $GLOBAL_N $LOCAL_M)

shift 2

for N in $(seq $GLOBAL_N); do
	for M in $(seq $LOCAL_M); do
		netjail_node_clear $(netjail_print_name "N" $N $M)
	done
	
	netjail_bridge_clear $(netjail_print_name "r" $N)
	netjail_node_clear $(netjail_print_name "R" $N)
done

netjail_bridge_clear $NETWORK_NET

echo "Done"