-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
244 lines (195 loc) · 7.42 KB
/
Copy pathstart.sh
File metadata and controls
244 lines (195 loc) · 7.42 KB
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
#!/bin/sh
#
#Copyright (C) 2018 Muhammad Farras Rayhand
#
echo "Script ini dibuat untuk ubuntu 16.04"
read -r -p "Apakah anda ingin menambah Repo Kambing? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
echo "Yes"
echo "Menambah Repository Kambing"
ex -sc '1i|#' -cx /etc/apt/sources.list
ex -sc '1i|deb http://kambing.ui.ac.id/ubuntu xenial-proposed main restricted universe multiverse' -cx /etc/apt/sources.list
ex -sc '1i|deb http://kambing.ui.ac.id/ubuntu xenial-backports main restricted universe multiverse' -cx /etc/apt/sources.list
ex -sc '1i|deb http://kambing.ui.ac.id/ubuntu xenial-security main restricted universe multiverse' -cx /etc/apt/sources.list
ex -sc '1i|deb http://kambing.ui.ac.id/ubuntu xenial-updates main restricted universe multiverse' -cx /etc/apt/sources.list
ex -sc '1i|deb http://kambing.ui.ac.id/ubuntu xenial main restricted universe multiverse' -cx /etc/apt/sources.list
ex -sc '1i|#REPO KAMBING' -cx /etc/apt/sources.list
echo "Melakukan update repository"
apt-get update
echo "Penambahan Repository Selesai..."
;;
[nN][oO]|[nN])
echo "No"
;;
*)
echo "Invalid input..."
;;
esac
####################################################################################################################################
read -r -p "Apakah anda ingin menambah Repo Buaya? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
echo "Yes"
echo "Menambah Repository Buaya"
ex -sc '1i|#' -cx /etc/apt/sources.list
ex -sc '1i|deb http://buaya.klas.or.id/ubuntu/ xenial-proposed main restricted universe multiverse' -cx /etc/apt/sources.list
ex -sc '1i|deb http://buaya.klas.or.id/ubuntu/ xenial-backports main restricted universe multiverse' -cx /etc/apt/sources.list
ex -sc '1i|deb http://buaya.klas.or.id/ubuntu/ xenial-security main restricted universe multiverse' -cx /etc/apt/sources.list
ex -sc '1i|deb http://buaya.klas.or.id/ubuntu/ xenial-updates main restricted universe multiverse' -cx /etc/apt/sources.list
ex -sc '1i|deb http://buaya.klas.or.id/ubuntu/ xenial main restricted universe multiverse' -cx /etc/apt/sources.list
ex -sc '1i|#REPO BUAYA' -cx /etc/apt/sources.list
echo "Melakukan update repository"
apt-get update
echo "Penambahan Repository Selesai..."
;;
[nN][oO]|[nN])
echo "No"
;;
*)
echo "Invalid input..."
;;
esac
####################################################################################################################################
read -r -p "Apakah anda ingin Menginstall Packet SSH? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
echo "Yes"
apt-get install ssh -y
echo -n "Masukkan IP Address anda [contoh 192.168.1.1] : "
read aipi
echo -n "Masukkan Port SSH [default = 22] : "
read port
sed -i "s/22/$port/g" /etc/ssh/sshd_config
service ssh restart
/etc/init.d/ssh status
echo "Installasi SSH Selesai, Connect menggunakan PUTTY atau aplikasi SSH lainnya dengan format $aipi:$port"
;;
[nN][oO]|[nN])
echo "No"
;;
*)
echo "Invalid input..."
;;
esac
#####################################################################################################################################
read -r -p "Apakah anda ingin Menginstall Service DHCP Server? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
echo "Yes"
apt-get install isc-dhcp-server -y
echo -n "Masukkan Interface untuk DHCP Server [contoh ens33] : "
read int
echo -n "Masukkan IP Address untuk DHCP Server [contoh 192.168.1.1] : "
read ip
echo -n "Masukkan IP Network untuk DHCP Server [contoh 192.168.1.0] : "
read net
echo -n "Masukkan IP Broadcast untuk DHCP Server [contoh 192.168.1.255] : "
read broad
echo -n "Masukkan NetMask untuk DHCP Server [contoh 255.255.255.0] : "
read mask
echo -n "Masukkan IP Range untuk DHCP Server [contoh 192.168.1.2 192.168.1.254] : "
read range
echo -n "Masukkan Domain untuk DHCP Server [contoh domain.net] : "
read domain
echo -n "Masukkan DNS Server untuk DHCP Server [contoh 192.168.1.1, 8.8.8.8] : "
read dns
echo "subnet $net netmask $mask {" >> /etc/dhcp/dhcpd.conf
echo "range $range;" >> /etc/dhcp/dhcpd.conf
echo "option domain-name-servers $dns;" >> /etc/dhcp/dhcpd.conf
echo "option domain-name =$domain=;" >> /etc/dhcp/dhcpd.conf
echo "option subnet-mask $mask;" >> /etc/dhcp/dhcpd.conf
echo "option routers $ip;" >> /etc/dhcp/dhcpd.conf
echo "option broadcast-address $broad;" >> /etc/dhcp/dhcpd.conf
echo "default-lease-time 600;" >> /etc/dhcp/dhcpd.conf
echo "max-lease-time 7200;" >> /etc/dhcp/dhcpd.conf
echo "}" >> /etc/dhcp/dhcpd.conf
sed -i 's/"/@/g' /etc/default/isc-dhcp-server
sed -i "s/INTERFACES=@@/ INTERFACES=@$int@/g" /etc/default/isc-dhcp-server
sed -i 's/@/"/g' /etc/default/isc-dhcp-server
sed -i 's/=/"/g' /etc/dhcp/dhcpd.conf
service isc-dhcp-server restart
/etc/init.d/isc-dhcp-server status
echo "Installasi Service DHCP Server Selesai..."
;;
[nN][oO]|[nN])
echo "No"
;;
*)
echo "Invalid input..."
;;
esac
#####################################################################################################################################
read -r -p "Apakah anda ingin menginstall packet untuk zimbra [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
echo "Yes"
echo "Installasi Packet yang dibutuhkan oleh zimbra"
apt-get install libgmp10 wget libperl5.22 unzip pax sysstat sqlite3 libaio1 -y
echo "Proses Installasi Selesai..."
;;
[nN][oO]|[nN])
echo "No"
;;
*)
echo "Invalid input..."
;;
esac
####################################################################################################################################
read -r -p "Apakah anda ingin menginstall packet bind9 [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
echo "Yes"
echo "Installasi Packet bind9"
apt-get install bind9 -y
echo "Proses Installasi Selesai..."
read -r -p "Apakah anda ingin membuat domain? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
echo "Yes"
echo -n "Masukkan ip address anda [contoh 192.168.1.1] : "
read ipadd
echo -n "Masukkan domain yang akan dibuat [contoh = domain.net] : "
read domain
echo -n "Masukkan network id untuk domain yang dibuat [contoh 192.168.1.1 = 1.168.192] : "
read ip
echo -n "Masukkan host id untuk domain yang dibuat [contoh 192.168.1.1/24 = 1] : "
read host
echo -n "Masukkan nama db untuk domain yang akan dibuat [contoh = db.forward] : "
read forward
echo -n "Masukkan nama db untuk ip [contoh = db.reverse] : "
read reverse
ex -sc "i|zone =$domain= {" -cx /etc/bind/named.conf.default-zones
ex -sc "i| type master;" -cx /etc/bind/named.conf.default-zones
ex -sc "i| file =/etc/bind/$forward=;" -cx /etc/bind/named.conf.default-zones
ex -sc "i|};" -cx /etc/bind/named.conf.default-zones
cp /etc/bind/db.local /etc/bind/$forward
sed -i "s/127.0.0.1/$ipadd/g" /etc/bind/$forward
sed -i "s/localhost/$domain/g" /etc/bind/$forward
ex -sc "i|zone =$ip.in-addr.arpa= {" -cx /etc/bind/named.conf.default-zones
ex -sc "i| type master;" -cx /etc/bind/named.conf.default-zones
ex -sc "i| file =/etc/bind/$reverse=;" -cx /etc/bind/named.conf.default-zones
ex -sc "i|};" -cx /etc/bind/named.conf.default-zones
cp /etc/bind/db.127 /etc/bind/$reverse
sed -i "s/localhost/$domain/g" /etc/bind/$reverse
sed -i "s/1.0.0/$host/g" /etc/bind/$reverse
sed -i 's/=/"/g' /etc/bind/named.conf.default-zones
service bind9 restart
;;
[nN][oO]|[nN])
echo "No"
;;
*)
echo "Invalid input..."
;;
esac
;;
[nN][oO]|[nN])
echo "No"
;;
*)
echo "Invalid input..."
;;
esac
clear
echo "Created BY : Muhammad Farras Rayhand"