-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflowspace-deletion.sh
54 lines (37 loc) · 1.28 KB
/
flowspace-deletion.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
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
#
# Name : flowspace-preparation.sh
# Description : Script for OF@TEIN Infrastructure Experiment Slice and FlowSpace Configuration
#
# Created by : TEIN_GIST@nm.gist.ac.kr
# Version : 0.1
# Last Update : March, 2014
#
# Main Script
# Required Parameter : 4 [Slice Name, Controller, VLAN]
FLOWVISOR="103.22.221.52"
PARAMETER=1
if [ $# -ne $PARAMETER ]; then
echo -e ""
echo -e "Usage : ./flowspace-preparation.sh [Slice_Name]\n"
echo -e "Available Commands are: \n"
echo -e "Slice_Name Unique Slice Name for FlowSpace"
exit 0
else
# Check the VM name and Create if not exists
echo -e "Checking the Slice and FlowSpace with the same name ..."
for FLOWPARAM in $1
do
if [[ -n $(ssh netcs@$FLOWVISOR 'fvctl-json --passwd-file=passwd list-flowspace' | grep $FLOWPARAM) ]]; then
export FLOWPARAM2="\033[32m[$FLOWPARAM]\033[0m"
echo -e "Parameter $FLOWPARAM2 is exist !!!"
else
export FLOWPARAM2="\033[31m[$FLOWPARAM]\033[0m"
echo -e "Parameter $FLOWPARAM2 is not exist !!!"
exit 0
fi
done
echo -e "Creating Slice and Adding FlowSpace ..."
ssh netcs@$FLOWVISOR "fvctl-json --passwd-file=passwd remove-flowspace $1-FLOWSPACE"
ssh netcs@$FLOWVISOR "fvctl-json --passwd-file=passwd remove-slice $1"
fi