-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathremove_solution
More file actions
executable file
·53 lines (46 loc) · 1.21 KB
/
remove_solution
File metadata and controls
executable file
·53 lines (46 loc) · 1.21 KB
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
#!/bin/bash
#set -x
usage() {
echo "usage: $(basename $0) --sd <solution definition file name> --spark-version <spark version>"
exit 1;
}
while [ ! -z $2 ]; do
case "$1" in
--sd ) solution_def_file=$2 ;;
* ) usage ;;
esac
shift
done
echo "solution definition file="$solution_def_file
remove_service(){
service_name=$1
dep_service="$2"
bd_ip=$3
bd_user=$4
server=root@$bd_ip
ssh $server "$service_name/cleanup.sh" < /dev/null
ssh $server rm -rf $service_name < /dev/null
if [ "$dep_service" != "none" ] ; then
for i in $dep_service
do
ssh $server "$i/cleanup.sh" < /dev/null
done
fi
}
./stop_solution --sd $solution_def_file
while IFS=',' read -r f1 f2 f3 f4 f5 f6 f7
do
## Ignore lines start with "#"
case $f1 in
\#*) continue;;
"") continue;;
esac
echo "************************************** "
echo "Service Name="$f1
echo " Required Service="$f2
echo " Service Location="$f3
echo " Service User Name="$f4
echo "************************************** "
remove_service $f1 "$f2" $f3 $f4
done < "$solution_def_file"
./solution_status --sd $solution_def_file