|
|
@ -2,22 +2,32 @@ |
|
|
|
|
|
|
|
|
# Constants |
|
|
# Constants |
|
|
|
|
|
|
|
|
|
|
|
BACKUP_SUFFIX='.ORIGINAL' |
|
|
|
|
|
|
|
|
# Functions |
|
|
# Functions |
|
|
|
|
|
|
|
|
function uninstall { |
|
|
|
|
|
if [[ -f /etc/bash.bashrc.ORIGINAL ]]; then |
|
|
|
|
|
sudo rm /etc/bash.bashrc |
|
|
|
|
|
sudo mv /etc/bash.bashrc.ORIGINAL /etc/bash.bashrc |
|
|
|
|
|
|
|
|
function restore { |
|
|
|
|
|
local path="$1" |
|
|
|
|
|
local backup="${path}${BACKUP_SUFFIX}" |
|
|
|
|
|
if [[ -f "$backup" ]]; then |
|
|
|
|
|
sudo rm "$path" |
|
|
|
|
|
sudo mv "$backup" "$path" |
|
|
|
|
|
echo "$path restored!" |
|
|
fi |
|
|
fi |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if [[ -f /etc/inputrc.ORIGINAL ]]; then |
|
|
|
|
|
sudo rm /etc/inputrc |
|
|
|
|
|
sudo mv /etc/inputrc.ORIGINAL /etc/inputrc |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
function uninstall { |
|
|
|
|
|
restore /etc/bash.bashrc |
|
|
|
|
|
restore /etc/inputrc |
|
|
|
|
|
restore /etc/skel/.bashrc |
|
|
|
|
|
|
|
|
sudo rm /etc/profile.d/20-miaou-bash.sh |
|
|
sudo rm /etc/profile.d/20-miaou-bash.sh |
|
|
sudo rm -f /etc/vimrc/vimrc.{azerty,core,local,miaou,rookie} |
|
|
sudo rm -f /etc/vimrc/vimrc.{azerty,core,local,miaou,rookie} |
|
|
|
|
|
sudo rm -f /usr/bin/miaou-bash |
|
|
sudo rm -rf /opt/miaou-bash |
|
|
sudo rm -rf /opt/miaou-bash |
|
|
|
|
|
|
|
|
|
|
|
echo 'MIAOU-BASH fully uninstalled, previous settings have been restored from original' |
|
|
|
|
|
echo -e "To reset your shell, please run:\n\texec bash -l" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# Main |
|
|
# Main |
|
|
@ -27,8 +37,6 @@ assert_system_mode |
|
|
sudo_root |
|
|
sudo_root |
|
|
if _confirm_destructive 2>/dev/null; then |
|
|
if _confirm_destructive 2>/dev/null; then |
|
|
uninstall |
|
|
uninstall |
|
|
echo 'MIAOU-BASH fully uninstalled, previous settings have been restored from original' |
|
|
|
|
|
echo "to reset your shell, please run: \`exec bash -l\`" |
|
|
|
|
|
else |
|
|
else |
|
|
builtin exit 1 |
|
|
builtin exit 1 |
|
|
fi |
|
|
fi |