-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
66 lines (55 loc) · 2.15 KB
/
install.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
#!/usr/bin/env bash
echo "########################################"
echo "# Stoffel dotfiles setup #"
echo "########################################"
echo "---------------------------"
echo "- Determining OS -"
echo "---------------------------"
echo ${OS}
if [[ -f /etc/redhat-release ]]; then
OS=CentOS
elif [[ -f /etc/debian_version ]]; then
OS=Debian
fi
echo "OS is ${OS}"
echo "Exporting OS variable for all scripts"
export OS
RED="\033[1;31m"
GREEN="\033[1;32m"
NOCOLOR="\033[0m"
echo "-----------------------------------"
echo "- Finding install.sh files -"
echo "-----------------------------------"
for Directory in *; do
if [[ -d ${Directory} ]]; then
for file in $(ls ${Directory}); do
if [[ ${file} == "install.sh" ]]; then
echo "-----------------------------------"
echo "- Found ${Directory}/${file} -"
echo "-----------------------------------"
read -r -p "Installing ${Directory} with sudo privileges are you sure you want to continue? [Y/n]" input
case ${input} in
[yY][eE][sS]|[yY])
echo -e "${GREEN}-----------------------------------"
echo -e "- Executing ${Directory}/${file} -"
echo -e "-----------------------------------${NOCOLOR}"
bash ${Directory}/${file}
;;
[nN][oO]|[nN])
echo -e "${RED}Not installing ${Directory}${NOCOLOR}"
continue
;;
*)
echo "${GREEN}-----------------------------------"
echo "- Executing ${Directory}/${file} -"
echo "-----------------------------------${NOCOLOR}"
bash ${Directory}/${file}
;;
esac
echo "-----------------------------------"
echo "- Executed ${Directory}/${file} -"
echo "-----------------------------------"
fi
done
fi
done