From 98b39e73545faf7b8bcd84e2ab913ee32c193b6c Mon Sep 17 00:00:00 2001 From: Nyr Date: Wed, 21 Jan 2015 03:03:14 +0100 Subject: [PATCH] Added a confirmation dialog before removing --- openvpn-install.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index ba2c4f6..3b336e1 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -101,13 +101,17 @@ if [[ -e /etc/openvpn/server.conf ]]; then exit ;; 3) - apt-get remove --purge -y openvpn openvpn-blacklist - rm -rf /etc/openvpn - rm -rf /usr/share/doc/openvpn - sed -i '/--dport 53 -j REDIRECT --to-port/d' /etc/rc.local - sed -i '/iptables -t nat -A POSTROUTING -s 10.8.0.0/d' /etc/rc.local echo "" - echo "OpenVPN removed!" + read -p "Do you really want to remove OpenVPN? [y/n]: " -e -i n REMOVE + if [[ "$REMOVE" = 'y' ]]; then + apt-get remove --purge -y openvpn openvpn-blacklist + rm -rf /etc/openvpn + rm -rf /usr/share/doc/openvpn + sed -i '/--dport 53 -j REDIRECT --to-port/d' /etc/rc.local + sed -i '/iptables -t nat -A POSTROUTING -s 10.8.0.0/d' /etc/rc.local + echo "" + echo "OpenVPN removed!" + fi exit ;; 4) exit;;