thelinuxlist/scripts/pmauninstall.sh

48 lines
975 B
Bash

#!/bin/bash
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 wasn't an option..."
;;
esac
done
sudo apt remove phpmyadmin -y
sudo apt-get autoremove -y
rm -rf /usr/share/phpmyadmin/
sudo systemctl restart apache2
while true
do
read -r -p "Would you like to also uninstall apache2? This is not reversible. [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "That wasn't an option..."
;;
esac
done
sudo systemctl stop apache2
sudo apt remove apache2 -y
sudo apt-get autoremove -y