-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto
270 lines (248 loc) · 11.9 KB
/
auto
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
echo -e '▒█░▒░▓█░█▒░▒▒█░█▓░▒░█▓ █████▒ ▓█ ▒█▓▓█▓ ██████ ▓████▒░█░ ░█████░▒████▓ ▓█████░
░▓ █▓▓█ ▓ ██▒█░▓░▓█░█▓ ▓▒ █▓ ▒█ ▒▓▓▓█▓ ▓░█▓▒█░▓▒ █▓ ▓ ░█░ ▓ ▒▓ ▓█ ▓▒▓█▒█▒
▒█▒█▓▓█░█▓▓█▒█▒█▓▓█▒█▓ █▓ █▓░▓░ ▓█ ██▒▒█▓░█▒█▓▒█░██ █▓░█▒ ░ ▒█▒ ░▓ ██ ██ █▓▓█░█▒
░█████▓ ██████ ▓█████░▓█ █████░░█████ █▓ █▓░█▒░░▒█ ▓████▒░█████▒█▓ █████ ▒████▓ █▓░▒░█▒ ';
echo -e "$GREEN
# Powered By DjAmol Group Inc #
# Email : [email protected] #
# Website : www.djamol.com #
# Copyright By PatilWeb.com #
# IG:PatilWeb FB:PatilWeb TW:PatilWeb #
$RESET";
date +"%r" >> $BUILD;echo "Status : Auto Installation Start" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto Bind Installation" >> $BUILD
echo -e "\e[32m########################################\n#### BIND DNS Software #########\n########################################"
if [ $BIND = "true" ]
then
source "$SCRIPTPATH/inc/binddns.sh";
else
echo "Reject By USER Bind INstall";date +"%r" >> $BUILD;echo "Status : Bind Reject By USER" >> $BUILD
fi
date +"%r" >> $BUILD;echo "Status : Auto Bind Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto Development Tool" >> $BUILD
if [ $OSN = "debian" ]
then
apt update
apt install build-essential
echo "Debian groupinstall ----Development Tools Success";date +"%r" >> $BUILD;
else
if yum -y groupinstall "Development Tools"; then
echo -e "\033[33;32m yum -y groupinstall ----Development Tools Success ";date +"%r" >> $BUILD;echo "Success : Development Tools Install" >> $BUILD
else
echo -e "\033[33;31m yum -y groupinstall ----Development Tools Failed";date +"%r" >> $BUILD;echo "Failed : Development Tools Install" >> $BUILD
fi
fi
if yum -y install sudo expect; then
echo -e "\033[33;32m Sudo Success";date +"%r" >> $BUILD;echo "Success : Sudo Install" >> $BUILD
else
echo -e "\033[33;31m Sudo Failed";date +"%r" >> $BUILD;echo "Failed : Sudo Install" >> $BUILD
fi
echo -e "\033[33;34m Blue"
if mkdir $SCRIPTPATH/src; then
echo -e "\033[33;32m making dir src Success";date +"%r" >> $BUILD;echo "Success : src Making dir in $SCRIPTPATH/" >> $BUILD
else
echo -e "\033[33;31m making dir Failed";date +"%r" >> $BUILD;echo "Failed : src making dir $SCRIPTPATH/" >> $BUILD
fi
if cd $SCRIPTPATH/src; then
echo -e "\033[33;32m go to $SCRIPTPATH/src Success";date +"%r" >> $BUILD;echo "Success : Go To SRC dir $SCRIPTPATH/src" >> $BUILD
else
echo -e "\033[33;31m go to $SCRIPTPATH/src Failed";date +"%r" >> $BUILD;echo "Failed : Go To SRC dir $SCRIPTPATH/src" >> $BUILD
fi
clear
date +"%r" >> $BUILD;echo "Status : Auto Devlopment Tool END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto CURL Installation" >> $BUILD
echo -e "\e[32m########################################\n#### CURL Software #########\n########################################"
if [ $CURL = "true" ]
then
source "$SCRIPTPATH/inc/curl.sh";
else
echo "Reject By USER CURL INstall"
fi
date +"%r" >> $BUILD;echo "Status : Auto CURL Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto MariaDB Installation" >> $BUILD
echo -e "\e[32m########################################\n#### MariaDB Software #########\n########################################"
if [ $DB = "true" ]
then
source "$SCRIPTPATH/inc/mysql.sh";
else
echo "Reject By USER MariaDB INstall"
fi
date +"%r" >> $BUILD;echo "Status : Auto MariaDB Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto Apache Installation Start" >> $BUILD
echo -e "\e[32m########################################\n#### Apache2.4 Server Soft #########\n#####################################"
if [ $Apache = "true" ]
then
yum remove httpd -y; source "$SCRIPTPATH/inc/aprq.sh";source "$SCRIPTPATH/inc/apache.sh"; source "$SCRIPTPATH/inc/apacheDOSmod.sh";
else
echo "Reject By USER Apache INstall"
fi
date +"%r" >> $BUILD;echo "Status : Auto Apache Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto Apache Create SSL Certificate" >> $BUILD
mkdir /usr;mkdir /usr/share;mkdir /usr/share/ssl; mkdir /usr/share/ssl//certs;
#CAC=IN #CAS=MAH #CAL=City #CAO="INDIA ORG" #CAU="DA Group" #CACM="serv.djamol.com" #CAM="[email protected]"
SSLCERt=$(expect -c "
set timeout 35
spawn openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /usr/share/ssl/certs/amol.key -out /usr/share/ssl/certs/amol.cert
expect \"Country Name*:\"
send \"$CAC\r\"
expect \"State*:\"
send \"$CAS\r\"
expect \"Locality*:\"
send \"$CAL\r\"
expect \"Organization Name*:\"
send \"$CAO\r\"
expect \"Organizational Unit*:\"
send \"$CAU\r\"
expect \"Common Name*:\"
send \"$CACM\r\"
expect \"Email*:\"
send \"$CAM\r\"
expect eof
")
echo "$SSLCERt"
SSLHTTPS=$(expect -c "
set timeout 35
spawn openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /usr/share/ssl/certs/ssl.crt -out /usr/share/ssl/certs/ssl.crt
expect \"Country Name*:\"
send \"$CAC\r\"
expect \"State*:\"
send \"$CAS\r\"
expect \"Locality*:\"
send \"$CAL\r\"
expect \"Organization Name*:\"
send \"$CAO\r\"
expect \"Organizational Unit*:\"
send \"$CAU\r\"
expect \"Common Name*:\"
send \"$CACM\r\"
expect \"Email*:\"
send \"$CAM\r\"
expect eof
")
echo "$SSLHTTPS"
date +"%r" >> $BUILD;echo "Status : Auto Apache SSL Cert END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto PHP Installation Start" >> $BUILD
echo -e "\e[32m########################################\n#### PHP Multiple Version Package/Software #########\n#####################################"
if [ $PHPe = "true" ]
then
source "$SCRIPTPATH/inc/phpauto.sh";
else
echo "Reject By USER PHP INstall"
fi
date +"%r" >> $BUILD;echo "Status : Auto PHP Multiple Version Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto Cron JOB Installation Start" >> $BUILD
echo -e "\e[32m########################################\n#### Cron JOB Software #########\n#####################################"
if [ $CRON = "true" ]
then
source "$SCRIPTPATH/inc/cron.sh";
else
echo "Reject By USER Cron JOB INstall"
fi
date +"%r" >> $BUILD;echo "Status : Auto CronJOB Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto ConfigServer Security Installation Start" >> $BUILD
echo -e "\e[32m###############################\n###ConfigServer Security & Firewall #########\n#####################################"
if [ $CSSF = "true" ]
then
source "$SCRIPTPATH/inc/csf.sh";
else
echo "Reject By USER ConfigServer INstall"
fi
date +"%r" >> $BUILD;echo "Status : Auto ConfServerSec Firewall Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto WEBMIN Installation Start" >> $BUILD
echo -e "\e[32m###############################\n###Webmin Control Panel #########\n#####################################"
if [ $WCP = "true" ]
then
source "$SCRIPTPATH/inc/cvpsauto.sh";
else
echo "Reject By USER Webmin INstall"
fi
date +"%r" >> $BUILD;echo "Status : Auto Webmin Control Panel Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto Proftpd Installation Start" >> $BUILD
echo -e "\e[32m###############################\n###Proftpd Software #########\n#####################################"
if [ $PFTP = "true" ]
then
source "$SCRIPTPATH/inc/ftp.sh";
else
echo "Reject By USER Proftpd INstall"
fi
date +"%r" >> $BUILD;echo "Status : Auto PROFTPD Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto POSTFIX Installation Start" >> $BUILD
echo -e "\e[32m###############################\n###PostFix Mail Software #########\n#####################################"
if [ $PostFix = "true" ]
then
source "$SCRIPTPATH/inc/postfixauto.sh";
source "$SCRIPTPATH/inc/opendkim.sh";
else
echo "Reject By USER PostFix INstall"
fi
echo -e "\e[32m###############################\n###Postfix-dovecot Mail Software #########\n#####################################"
if [ $PostDove = "true" ]
then
source "$SCRIPTPATH/inc/maildove.sh";
source "$SCRIPTPATH/inc/opendkim.sh";
else
echo "Reject By USER Postfix-dovecot INstall"
fi
echo -e "\e[32m########################################\n#### AWStats Software #########\n########################################"
if [ $AW = "true" ]
then
source "$SCRIPTPATH/inc/awstats.sh";
else
echo "Reject By USER AWStats INstall"
fi
date +"%r" >> $BUILD;echo "Status : vnStat - Light Weight Console-based Network Monitor Start" >> $BUILD
source "$SCRIPTPATH/inc/vnstat.sh";
date +"%r" >> $BUILD;echo "Status : Auto vnStat Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto AWStats Web analytics Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto POSTFIX Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Generate SSL Certificate Files" >> $BUILD
source "$SCRIPTPATH/inc/ssl.sh";
date +"%r" >> $BUILD;echo "Status : Generate SSL Certificate END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Last Setup bash Start" >> $BUILD
source "$SCRIPTPATH/inc/last.sh";
date +"%r" >> $BUILD;echo "Status : Last Setup bash END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto Extra Domain conf Start" >> $BUILD
source "$SCRIPTPATH/inc/domainauto.sh";
date +"%r" >> $BUILD;echo "Status : Auto Extra Domain Conf END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto PERL And NET-SSL Installation Start" >> $BUILD
yum -y install perl perl-CPAN perl-Net-SSLeay perl-IO-Socket-SSL
date +"%r" >> $BUILD;echo "Status : Auto PERL And NET-SSL Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto END OF Server Setup Installation Start" >> $BUILD
source "$SCRIPTPATH/inc/end.sh";
date +"%r" >> $BUILD;echo "Status : Auto END OF Server Setup Installation END" >> $BUILD
## Customize program run any where
mkdir /amol
#export PATH="$PATH:/pro"
#cp $SCRIPTPATH/pprogram/addftp /amol/addftp
#chmod -R +x /amol
service apache2 reload
date +"%r" >> $BUILD;echo "Status : Auto NGINX Installation Start" >> $BUILD
echo -e "\e[32m########################################\n#### NGINX Reverse Proxy Server Soft #########\n#####################################"
if [ $NGINX = "true" ]
then
source "$SCRIPTPATH/inc/nginx.sh";
else
echo "Reject By USER NGINX INstall"
fi
date +"%r" >> $BUILD;echo "Status : Auto NGINX Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : Auto FFMPEG Installation Start" >> $BUILD
echo -e "\e[32m###############################\n###FFMPEG SOFT #########\n#####################################"
if [ $FF = "true" ]
then
source "$SCRIPTPATH/inc/ffmpeg.sh";
else
echo "Reject By USER ffmpeg INstall"
fi
date +"%r" >> $BUILD;echo "Status : Auto FFMPEG Installation END" >> $BUILD
date +"%r" >> $BUILD;echo "Status : SSH PORT CHANGE 55 " >> $BUILD
service sshd restart
chkconfig mysql on
chkconfig apache2 on
chkconfig named on
chkconfig sshd on
###service iptables restart
iptables="iptables"
#${iptables} -F
#iptables -P INPUT ACCEPT
#iptables -P FORWARD ACCEPT
#iptables -P OUTPUT ACCEPT