MIAOU-BASH is a collection of scripts and configurations designed to enhance your terminal experience. As the name suggests, it is built on Bash and is designed to work on most modern GNU/Linux systems.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
999 B

# Constants
BACKUP_SUFFIX='.ORIGINAL'
# Functions
function restore {
local path="$1"
local backup="${path}${BACKUP_SUFFIX}"
sudo rm "$path"
if [[ -f "$backup" ]]; then
sudo mv "$backup" "$path"
echo "$path restored!"
fi
}
function uninstall {
restore /etc/bash.bashrc
restore /etc/inputrc
restore /etc/skel/.bashrc
sudo rm -f /etc/profile.d/20-miaou-bash.sh # deprecated: for older version
sudo rm -f /etc/profile.d/zz-miaou-bash.sh
sudo rm -f /etc/vimrc/vimrc.{azerty,core,local,miaou,rookie}
sudo rm -f /etc/sudoers.d/miaou-bash
sudo rm -rf /var/lib/miaou-bash
sudo rm -r /etc/bash_completion.d/miaou-bash.complete
sudo rm -f /usr/bin/{miaou-bash,pkg_add}
sudo rm -rf /opt/miaou-bash
cat <<EOF
MIAOU-BASH succesfully uninstalled.
Previous settings have been restored from original.
EOF
}
# Main
source "$MIAOU_BASH_DIR"/lib/functions.bash
assert_system_mode
sudo_root
if _confirm_destructive 2>/dev/null; then
uninstall
else
builtin exit 1
fi