Compare commits
2 Commits
d863b6d7c8
...
d2142cb15f
Author | SHA1 | Date | |
---|---|---|---|
|
d2142cb15f | ||
|
cdd733e802 |
@ -102,6 +102,9 @@ a2enmod headers 2>>install.log &&
|
||||
a2enmod expires 2>>install.log &&
|
||||
a2enmod cgi.load 2>>install.log &&
|
||||
a2enmod ssl 2>>install.log &&
|
||||
a2enmod proxy 2>>install.log &&
|
||||
a2enmod proxy_http 2>>install.log &&
|
||||
|
||||
|
||||
if [ ! -f "/etc/apache2/sites-enabled/cms.conf" ]; then
|
||||
cat <<EOT > "/etc/apache2/sites-enabled/cms.conf"
|
||||
|
36
BashScripts/install-bind.sh
Normal file
36
BashScripts/install-bind.sh
Normal file
@ -0,0 +1,36 @@
|
||||
# Install using: sudo su -c "bash <(wget -qO- /url/to/install-bind.sh)"
|
||||
|
||||
REALUSER=$(logname)
|
||||
|
||||
apt update 2>>install.log
|
||||
|
||||
if ! ufw status | grep -q 'Status: active'; then
|
||||
echo "Installing UFW..."
|
||||
apt install ufw -y 2>>install.log &&
|
||||
ufw default allow outgoing 2>>install.log &&
|
||||
ufw default deny incoming 2>>install.log &&
|
||||
ufw allow ssh 2>>install.log &&
|
||||
ufw enable 2>>install.log
|
||||
fi
|
||||
if nslookup 127.0.0.1 | grep -q 'command not found'; then
|
||||
echo "Installing DNS utils..."
|
||||
apt install dnsutils 2>>install.log
|
||||
fi
|
||||
if ! named -v | grep -q 'BIND'; then
|
||||
echo "Installing BIND9..."
|
||||
apt install bind9 -y 2>>install.log &&
|
||||
ufw allow Bind9 -y 2>>install.log &&
|
||||
nslookup google.com 127.0.0.1
|
||||
fi
|
||||
if ! grep -q "listen-on {" "/etc/bind/named.conf.options"; then
|
||||
sed -i -e 's/^};/\tlisten-on { any; };\n};/mig' /etc/bind/named.conf.options
|
||||
fi
|
||||
if ! grep -q "allow-query" "/etc/bind/named.conf.options"; then
|
||||
sed -i -e 's/^};/\tallow-query { any; };\n};/mig' /etc/bind/named.conf.options
|
||||
fi
|
||||
if ! grep -q "\tforwarders {" "/etc/bind/named.conf.options"; then
|
||||
sed -i -e 's/^};/\tforwarders { 1.1.1.1; 8.8.8.8; 8.8.4.4; };\n};/mig' /etc/bind/named.conf.options
|
||||
fi
|
||||
named-checkconf && systemctl restart bind9
|
||||
|
||||
echo 'Installation complete'
|
Loading…
x
Reference in New Issue
Block a user