-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhidoop-init.sh
More file actions
executable file
·46 lines (41 loc) · 1.25 KB
/
Copy pathhidoop-init.sh
File metadata and controls
executable file
·46 lines (41 loc) · 1.25 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
#!/bin/bash
display_usage() {
echo -e "\033[1musage: ./hidoop-init.sh \033[1;31m<serversloginID>\033[0m"
}
display_logo() {
echo -e '\n\033[34m __ __ ______ ____ _____ _____ ____
/\ \/\ \/\__ _\ /\ _`\ /\ __`\/\ __`\/\ _`\
\ \ \_\ \/_/\ \/ \ \ \/\ \ \ \/\ \ \ \/\ \ \ \L\ \
\ \ _ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ,__/
\ \ \ \ \ \_\ \__\ \ \_\ \ \ \_\ \ \ \_\ \ \ \/
\ \_\ \_\/\_____\\\ \____/\ \_____\ \_____\ \_\
\/_/\/_/\/_____/ \/___/ \/_____/\/_____/\/_/ \n\033[0m'
echo -e " \033[1mValentin FLAGEAT, Baptiste GREAUD, Léo VINCENT\n"\
" \033[34mINP ENSEEIHT 2019-2020\033[0m\n\n"
}
# check whether user had supplied -h or --help, if yes display usage
if [[ ( $# == "--help") || $# == "-h" ]]
then
display_usage
exit 0
fi
# if no arguments supplied, display usage
if [ $# -le 0 ]
then
display_usage
exit 1
fi
if [ $# -le 1 ]
then
DATA_FOLDER="/work/hidoop-fgvb"
else
DATA_FOLDER=$2
fi
#run scripts through command line
chmod u+x config/*.sh hidoop-clear.sh hidoop-run.sh
#run scripts
id=$1
display_logo
config/ssh.sh $id
config/clean.sh $id $DATA_FOLDER
config/deploy.sh $id $DATA_FOLDER