diff --git a/remove-shelltweaks.sh b/remove-shelltweaks.sh new file mode 100755 index 0000000..b57675f --- /dev/null +++ b/remove-shelltweaks.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#Check script is running as root +if [ "$EUID" -ne 0 ] + then echo "Please run as Root" + exit 1 +fi + +apt-get purge fish -y + +# Iterate over each user's home directory, including /root +for homedir in /root /home/*; do + if [ -d "$homedir" ]; then + rm -rf $homedir/.config/fish + rm -rf $homedir/.config/starship.toml + fi +done + + +#Set all users back to bash +echo Reverting users to bash +# Loop through all users in /etc/passwd +while IFS=: read -r username _ _ _ _ homedir _; do + # Skip system accounts and users without a home directory + if [[ $homedir != "/nonexistent" && -d $homedir ]]; then + echo "Changing shell for user: $username" + sudo chsh -s /bin/bash "$username" + if [ $? -ne 0 ]; then + echo "Failed to change shell for user: $username" + fi + fi +done < /etc/passwd +