From 55de8e4d6a98061105c10c5151b6534d606ee1e3 Mon Sep 17 00:00:00 2001 From: randomshell <43271778+randomshell@users.noreply.github.com> Date: Sat, 15 Sep 2018 13:44:23 +0200 Subject: [PATCH] Ask to uninstall Unbound too --- openvpn-install.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/openvpn-install.sh b/openvpn-install.sh index f557209..30090be 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -225,6 +225,30 @@ if [[ -e /etc/openvpn/server.conf ]]; then done rm -rf /etc/openvpn rm -rf /usr/share/doc/openvpn* + + if [[ -e /etc/unbound/openvpn-server.conf ]]; then + # Remove Unbound integration with OpenVPN + rm /etc/unbound/openvpn-server.conf + sed -i '/openvpn-server.conf/d' /etc/unbound/unbound.conf + + read -rp "Do you want to remove Unbound, too? [y/n]: " -e -i n REMOVE + + if [[ "$REMOVE" = 'y' ]]; then + if [[ "$OS" = 'debian' ]]; then + apt-get autoremove --purge -y unbound + elif [[ "$OS" = 'arch' ]]; then + pacman -R unbound --noconfirm + else + yum remove unbound -y + fi + + echo "" + echo "Unbound removed!" + else + echo "" + echo "Unbound not removed!" + fi + fi echo "" echo "OpenVPN removed!" else