From acc3bb38487f2146dea798ad54907e254ade6ca8 Mon Sep 17 00:00:00 2001 From: Sophia Atkinson Date: Thu, 20 Oct 2022 11:00:18 -0700 Subject: [PATCH] Update 'scripts/pmauninstall.sh' --- scripts/pmauninstall.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/scripts/pmauninstall.sh b/scripts/pmauninstall.sh index 579c84e..29cb984 100644 --- a/scripts/pmauninstall.sh +++ b/scripts/pmauninstall.sh @@ -1,13 +1,21 @@ #!/bin/bash -while [ "$go" != 'y' ] && [ "$go" != 'n' ]; do - read -p "Would you like to uninstall phpMyAdmin? (y/n) " go +while true +do + read -r -p "Would you like to uninstall phpMyAdmin? [Y/n] " input + + case $input in + [yY][eE][sS]|[yY]) + break + ;; + [nN][oO]|[nN]) + break + ;; + *) + echo "That wasnt an option..." + ;; + esac done - -if [ "$go" == 'n' ]; then - exit -fi - sudo apt remove phpmyadmin -y sudo apt-get autoremove -y sudo systemctl restart apache2