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
936 B
47 lines
936 B
#!/usr/bin/env miaou-bash
|
|
|
|
# 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 /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 /var/lib/miaou-bash
|
|
sudo rm -r /etc/bash_completion.d/miaou-bash.complete
|
|
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
|