uninstall
This commit is contained in:
+18
-10
@@ -2,22 +2,32 @@
|
|||||||
|
|
||||||
# Constants
|
# Constants
|
||||||
|
|
||||||
|
BACKUP_SUFFIX='.ORIGINAL'
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
|
|
||||||
function uninstall {
|
function restore {
|
||||||
if [[ -f /etc/bash.bashrc.ORIGINAL ]]; then
|
local path="$1"
|
||||||
sudo rm /etc/bash.bashrc
|
local backup="${path}${BACKUP_SUFFIX}"
|
||||||
sudo mv /etc/bash.bashrc.ORIGINAL /etc/bash.bashrc
|
if [[ -f "$backup" ]]; then
|
||||||
|
sudo rm "$path"
|
||||||
|
sudo mv "$backup" "$path"
|
||||||
|
echo "$path restored!"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [[ -f /etc/inputrc.ORIGINAL ]]; then
|
function uninstall {
|
||||||
sudo rm /etc/inputrc
|
restore /etc/bash.bashrc
|
||||||
sudo mv /etc/inputrc.ORIGINAL /etc/inputrc
|
restore /etc/inputrc
|
||||||
fi
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user