-
Notifications
You must be signed in to change notification settings - Fork 0
/
teardown-lte-namespaces.sh
43 lines (37 loc) · 1.4 KB
/
teardown-lte-namespaces.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# cellular-satcom-emulator : Multipath Cellular and Satellite Emulation Testbed
# Copyright (C) 2023 Kaushik Chavali
#
# This file is part of the cellular-satcom-emulator.
#
# cellular-satcom-emulator is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# moon_teardown_namespaces()
# Remove all namespaces and the components within them.
function moon_teardown_namespaces() {
sudo ip netns del osnd-moon-cl
sudo ip netns del osnd-moon-clgw
sudo ip netns del osnd-moon-sv
sudo ip netns del osnd-moon-svgw
# Delete bridge and all its ports
sudo ovs-vsctl del-br br-lte
}
# If script is executed directly
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
declare -F log >/dev/null || function log() {
local level="$1"
local msg="$2"
echo "[$level] $msg"
}
moon_teardown_namespaces "$@"
fi