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.

47 lines
899 B

#!/usr/bin/env miaou-bash
# Constants
BACKUP_SUFFIX='.ORIGINAL'
# Functions
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
}
function uninstall {
restore /etc/bash.bashrc
restore /etc/inputrc
restore /etc/skel/.bashrc
sudo rm /etc/profile.d/20-miaou-bash.sh
sudo rm -f /etc/vimrc/vimrc.{azerty,core,local,miaou,rookie}
sudo rm -f /usr/bin/miaou-bash
sudo rm -f /etc/sudoers.d/miaou-bash
sudo rm -rf /opt/miaou-bash
cat <<EOF
MIAOU-BASH succesfully uninstalled.
Previous settings have been restored from original.
To reset this session, you can run:
exec bash -l
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