uninstall

This commit is contained in:
pvincent
2026-08-07 22:33:34 +04:00
parent 8519d254dd
commit 433370e730
3 changed files with 15 additions and 21 deletions
+2 -2
View File
@@ -265,11 +265,11 @@ function on_error {
}
function self_upgrade {
sudo -E "$MIAOU_BASH_DIR/lib/self-upgrade.bash"
sudo -E miaou-bash "$MIAOU_BASH_DIR"/lib/self-upgrade.bash
}
function uninstall {
echo "TODO: uninstall"
sudo -E miaou-bash "$MIAOU_BASH_DIR"/lib/uninstall.bash
}
function populate_error_arrays {
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env miaou-bash
# MAIN
[[ "$UID" -ne 0 ]] && echo 'root privilege required' && exit 1
cd
rm /etc/bash.bashrc
mv /etc/bash.bashrc.ORIGINAL /etc/bash.bashrc
rm /etc/inputc
mv /etc/inputrc.ORIGINAL /etc/inputrc
rm /etc/vimrc/vimrc.{azerty,core,local,miaou,rookie}
rm -rf /opt/miaou-bash
echo 'MIAOU-BASH fully uninstalled, restored from original'
-19
View File
@@ -1,19 +0,0 @@
#!/bin/bash
[ "$(id -u)" -ne 0 ] && echo 'root privilege required' && exit 1
BASEDIR=$PWD
[ ! "$BASEDIR" == '/opt/miaou-bash' ] && echo 'should be installed in /opt/miaou-bash directory' && exit 1
ORIGINAL="ORIGINAL"
declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc)
for i in "${arr[@]}"; do
if [[ -f "$i" ]] && [[ -f "$i.$ORIGINAL" ]]; then
echo "uninstalling $i"
rm "$i"
mv "$i.$ORIGINAL" "$i"
else
echo "$i" not overriden
fi
done