forked from acg-team/tral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_ext_software.sh
executable file
·59 lines (47 loc) · 1.59 KB
/
install_ext_software.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
#!/usr/bin/env bash
# Run this script after setting up TRAL by using setupTRAL.sh.
# This script will automatically called within setupTRAL or can be executed afterwards.
# You may need superuser privileges.
######################
### Prepare Filesystem
#provide paths from config file (has to be in the same directory than setupTRAL.sh)
. configTRAL_path.cfg
shopt -s nocasematch # making comparisons case-insensitive
set -euo pipefail # exit on errors and undefined vars
######################
### Installing external software
install_ext_software () {
if [[ "${ACCEPT_ALL:-no}" = "yes" ]]; then
y=y
else read -p "Would you like to install "$(basename "${software%%.sh}")"? Type \"y\" if YES:" y
fi
case $y in
[Yy]* )
. install_ext_software/"$(basename "$software")" || {
echo -e "\nA problem occured while trying to run install_ext_software/"$(basename "$software")"."
exit 1
}
;;
* )
echo -e "\nYou can install it later with the script $software.sh.\n"
;;
esac
}
if [[ "${ACCEPT_ALL:-no}" = "yes" ]]; then
yn=y
else read -p "Would you like to install any external software? yes(y) or no (n):" yn
fi
case $yn in
[Yy]* )
echo -e "\n"
for software in "install_ext_software"/*.sh
do install_ext_software $software || {
echo -e "\nA problem occured while trying to call install_ext_software."
exit 1
}
done
;;
[Nn]* )
echo -e "\nNo external software will be installed right now."
;;
esac