add config handling for unbound
This commit is contained in:
parent
599236e640
commit
d4be91c9f0
1 changed files with 22 additions and 2 deletions
|
|
@ -198,7 +198,23 @@ prefetch: yes' >> /etc/unbound/unbound.conf
|
||||||
qname-minimisation: yes
|
qname-minimisation: yes
|
||||||
prefetch: yes' > /etc/unbound/unbound.conf
|
prefetch: yes' > /etc/unbound/unbound.conf
|
||||||
elif [[ "$OS" = "gentoo" ]]; then
|
elif [[ "$OS" = "gentoo" ]]; then
|
||||||
emerge net-dns/unbound
|
emerge -q net-dns/unbound
|
||||||
|
|
||||||
|
# only for systemd
|
||||||
|
if isSystemD; then
|
||||||
|
sed -i 's|# use-systemd: no$|use-systemd: yes|' /etc/unbound/unbound.conf
|
||||||
|
sed -i 's|# do-daemonize: no$|do-daemonize: yes|' /etc/unbound/unbound.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -i 's|# interface: 192.0.2.153$|interface: 10.8.0.1|' /etc/unbound/unbound.conf
|
||||||
|
sed -i 's|# access-control: 127.0.0.0/8 allow|access-control: 10.8.0.1/24 allow|' /etc/unbound/unbound.conf
|
||||||
|
sed -i 's|# hide-identity: no|hide-identity: yes|' /etc/unbound/unbound.conf
|
||||||
|
sed -i 's|# hide-version: no|hide-version: yes|' /etc/unbound/unbound.conf
|
||||||
|
sed -i 's|# use-caps-for-id: no|use-caps-for-id: yes|' /etc/unbound/unbound.conf
|
||||||
|
sed -i 's|# prefetch: no|prefetch: yes|' /etc/unbound/unbound.conf
|
||||||
|
sed -i 's|# num-threads: 1|num-threads: 2|' /etc/unbound/unbound.conf
|
||||||
|
sed -i 's|private-address.*||' /etc/unbound/unbound.conf
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! "$OS" =~ (fedora|centos|amzn) ]];then
|
if [[ ! "$OS" =~ (fedora|centos|amzn) ]];then
|
||||||
|
|
@ -677,7 +693,7 @@ function installOpenVPN () {
|
||||||
# Install required dependencies and upgrade the system
|
# Install required dependencies and upgrade the system
|
||||||
pacman --needed --noconfirm -Syu openvpn iptables openssl wget ca-certificates curl
|
pacman --needed --noconfirm -Syu openvpn iptables openssl wget ca-certificates curl
|
||||||
elif [[ "$OS" = 'gentoo' ]]; then
|
elif [[ "$OS" = 'gentoo' ]]; then
|
||||||
emerge openvpn
|
emerge -q openvpn
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Find out if the machine uses nogroup or nobody for the permissionless group
|
# Find out if the machine uses nogroup or nobody for the permissionless group
|
||||||
|
|
@ -1202,6 +1218,8 @@ function removeUnbound () {
|
||||||
apt-get autoremove --purge -y unbound
|
apt-get autoremove --purge -y unbound
|
||||||
elif [[ "$OS" = 'arch' ]]; then
|
elif [[ "$OS" = 'arch' ]]; then
|
||||||
pacman --noconfirm -R unbound
|
pacman --noconfirm -R unbound
|
||||||
|
elif [[ "$OS" = 'gentoo' ]]; then
|
||||||
|
emerge -C unbound
|
||||||
elif [[ "$OS" =~ (centos|amzn) ]]; then
|
elif [[ "$OS" =~ (centos|amzn) ]]; then
|
||||||
yum remove -y unbound
|
yum remove -y unbound
|
||||||
elif [[ "$OS" = 'fedora' ]]; then
|
elif [[ "$OS" = 'fedora' ]]; then
|
||||||
|
|
@ -1276,6 +1294,8 @@ function removeOpenVPN () {
|
||||||
fi
|
fi
|
||||||
elif [[ "$OS" = 'arch' ]]; then
|
elif [[ "$OS" = 'arch' ]]; then
|
||||||
pacman --noconfirm -R openvpn
|
pacman --noconfirm -R openvpn
|
||||||
|
elif [[ "$OS" = 'arch' ]]; then
|
||||||
|
emerge -C openvpn
|
||||||
elif [[ "$OS" =~ (centos|amzn) ]]; then
|
elif [[ "$OS" =~ (centos|amzn) ]]; then
|
||||||
yum remove -y openvpn
|
yum remove -y openvpn
|
||||||
elif [[ "$OS" = 'fedora' ]]; then
|
elif [[ "$OS" = 'fedora' ]]; then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue