Update purge_nvidia.sh

modified selection/wording to be more clear, changed Y --> a and N --> s, also moved *) case to fail-safe exit.
This commit is contained in:
Will Russell
2023-01-02 17:29:20 -05:00
committed by GitHub
parent 2d79d0b733
commit f44f807d8a

View File

@@ -5,9 +5,9 @@ echo "note also that this script requires sudo to succeed, and will fail if you'
echo "commands that are going to be run are: 'apt purge nvidia-*' 'apt autoremove' 'dpkg -l | grep nvidia' 'apt-get --purge remove <dpkg-name>'"
echo "press enter to proceed, otherwise press ctrl+c to abort"
read go_opt
echo "proceeding with script; would you like to run the cleanup utility automatically (y) or manually (n)
echo "proceeding with script; Would you like to allow the script to attempt to [a]utomatically remove elements (a|A) or would you prefer to [s]elect what to remove? (S|s)
case $option in
y|Y) clear
a|A) clear
echo "proceeding with cleanup"
apt purge nvidia-* -y
apt autoremove -y
@@ -17,7 +17,7 @@ case $option in
echo "failure to install drivers at this stage may result in an unstable system configuration/no GUI on next boot"
echo "if you intend to boot to CLI only for additional debugging, run: $ sudo systemctl set-default multi-user.target"
exit 0
n|N|*) clear
s|S|) clear
echo "Proceeding with manual removal option, please confirm y/n at all prompts to clean up"
echo "commands that are going to be run are: 'apt purge nvidia-*' 'apt autoremove' 'dpkg -l | grep nvidia' 'apt-get --purge remove <dpkg-name>'"
echo "if you abort mid-stream for any reason, you can run the above manually instead to finish up cleanup"
@@ -29,6 +29,9 @@ case $option in
echo "failure to install drivers at this stage may result in an unstable system configuration/no GUI on next boot"
echo "if you intend to boot to CLI only for additional debugging, run: $ sudo systemctl set-default multi-user.target"
exit 0
*) clear
echo "unexpected answer provided, exiting out"
exit 1
esac
echo "cleanup completed, please ensure you re-install a graphics driver next BEFORE rebooting"
exit 0