-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_release.sh
124 lines (104 loc) · 3.25 KB
/
install_release.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/usr/bin/env bash
# # Written by Leandro Roser for Stanford University
set -e
YELLOW='\033[1;33m'
PURPLE='\033[0;35m'
NC='\033[0m'
option=""
function printfcol () {
printf '%b' "$1" "$2" "${NC}"
}
while true; do
echo -e "\nSelect an option:"
printfcol "${PURPLE}" "-------------------------\n"
printfcol "${YELLOW}" "1 <- Install in personal folder\n"
printfcol "${YELLOW}" "2 <- Install in group folder\n"
printfcol "${YELLOW}" "3 <- Configure your personal folder after a group install\n"
printfcol "${PURPLE}" "Your option: "
read -r option </dev/tty
case $option in
1)
printfcol "${YELLOW}" "\n\nInstalling and configuring in your personal folder...\n"
group=false
basepath="${HOME}"
break
;;
2)
printfcol "${YELLOW}" "\n\nInstalling in group folder...\n"
group=true
groupfol="/home/groups/$(id -ng)"
echo "Switching to $groupfol"
basepath="$groupfol"
cd "${basepath}"
break
;;
3)
printfcol "${YELLOW}" "\n\nConfiguring your personal folder for a group installation...\n"
group=true
break
;;
*)
printfcol "${YELLOW}" "\n\nInvalid option. Please select 1, 2, 3 or 4.\n"
;;
esac
done
mkdir odbc-module-tmp && curl -L https://github.com/the-tobias-project/odbc-module/releases/download/v1.1.0/odbc-centos7-R_4.2.0-devtoolset_10-unixodbc_2.3.9.tar.gz | tar -xvz -C odbc-module-tmp/
mv odbc-module-tmp/home/sherlock/odbc-module/ ./odbc-module
cd odbc-module/
if [ "$option" != "3" ];then
while true; do
printfcol "${PURPLE}" "\n--> Install databricks-cli? (y/n): "
read -r installlib </dev/tty
case "$installlib" in
[yY]*)
make get_databricks
echo "Databricks-cli successfully installed."
break
;;
[nN]*)
:
break
;;
*)
echo "Invalid input."
;;
esac
done
while true; do
printfcol "${PURPLE}" "\n--> Install Azure-cli? (y/n): "
read -r installlib </dev/tty
case "$installlib" in
[yY]*)
make get_azure
echo "Azure-cli successfully installed."
break
;;
[nN]*)
:
break
;;
*)
echo "Invalid input."
;;
esac
done
fi
while true; do
printfcol "${PURPLE}" "\n--> Configure? (y/n): "
read -r config </dev/tty
case "$config" in
[yY]*)
make configure group="${group}"
printfcol "${YELLOW}" "\nAuthorizing...\n"
make authorize
echo -e "Module successfully configured. To use this module reload your bash profile typing the command: ${YELLOW}. ~/.bashrc${NC}, and then load the module with: ${YELLOW}module load databricks-odbc/4.2.0${NC}"
break
;;
[nN]*)
break
;;
*)
echo "Invalid input."
;;
esac
done