uninstall
This commit is contained in:
+2
-2
@@ -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 {
|
||||
|
||||
@@ -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'
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user