-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
executable file
·101 lines (87 loc) · 3.44 KB
/
setup.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
#!/bin/bash
read -e -p "Enter Branch [master]/develop: " -i "master" branch
#check for ID
echo -e "\n>> Checking ID\n"
. /etc/os-release
echo -e "Distrubution Name = $NAME \n"
#Preparing Dialog
if [ $ID = "fedora" ]
then
if [ $(dnf -q list installed dialog &>/dev/null && echo "1" || echo "0") -eq 0 ]
then
sudo dnf -y -qq install dialog
fi
if [ $(dnf -q list installed openssh-server &>/dev/null && echo "1" || echo "0") -eq 0 ]
then
sudo dnf -y -qq install openssh-server
fi
elif [ $ID = "ubuntu" ]
then
if [ $(dpkg-query -W -f='${Status}' dialog 2>/dev/null | grep -c "ok installed") -eq 0 ]
then
sudo apt-get -y install -qq dialog
fi
if [ $(dpkg-query -W -f='${Status}' openssh-sever 2>/dev/null | grep -c "ok installed") -eq 0 ]
then
sudo apt-get -y install openssh-server
fi
fi
# Define Dialog Listing Here
cmd=(dialog --separate-output --checklist "Select Packages to Install:" 22 76 16)
options=(1 "Google Chrome" on # any option can be set to default to "on"
2 "Rocketchat" on
3 "SublimeText" on
4 "Code Insiders" off
5 "Docker-CE" on
6 "Docker Repo" off
7 "MongoDB " off
8 "lando " off )
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
# Define Installation Script URL Here
chrome="https://raw.githubusercontent.com/drpdishant/shell-scripts/$branch/install-chrome_$ID.sh"
rocketchat="https://raw.githubusercontent.com/drpdishant/shell-scripts/$branch/install-rocketchat_$ID.sh"
sublime="https://raw.githubusercontent.com/drpdishant/shell-scripts/$branch/install-sublime_$ID.sh"
code_insiders="https://raw.githubusercontent.com/drpdishant/shell-scripts/$branch/install-codeinsider_$ID.sh"
docker="https://raw.githubusercontent.com/drpdishant/shell-scripts/$branch/install-docker_$ID.sh"
gitclone="https://raw.githubusercontent.com/drpdishant/shell-scripts/$branch/git_clone.sh"
mongodb="https://raw.githubusercontent.com/drpdishant/shell-scripts/$branch/install-mongo_$ID.sh"
lando="https://raw.githubusercontent.com/drpdishant/shell-scripts/$branch/install-lando_$ID.sh"
#Define Script Execution Here
#Define Script Execution Here
for choice in $choices
do
case $choice in
1)
/bin/bash -c "$(curl -sL $chrome)"
echo -e "---------------------------------------------------- \n"
;;
2)
/bin/bash -c "$(curl -sL $rocketchat)"
echo -e "---------------------------------------------------- \n"
;;
3)
/bin/bash -c "$(curl -sL $sublime)"
echo -e "---------------------------------------------------- \n"
;;
4)
/bin/bash -c "$(curl -sL $code_insiders)"
echo -e "---------------------------------------------------- \n"
;;
5)
/bin/bash -c "$(curl -sL $docker)"
echo -e "---------------------------------------------------- \n"
;;
6)
/bin/bash -c "$(curl -sL $gitclone)"
echo -e "---------------------------------------------------- \n"
;;
7)
/bin/bash -c "$(curl -sL $mongodb)"
echo -e "---------------------------------------------------- \n"\
;;
8)
/bin/bash -c "$(curl -sL $lando)"
echo -e "---------------------------------------------------- \n"
esac
done