correction instruction uninstall: sauvegarde du .bashrc defectueuse

This commit is contained in:
jhechavarria
2018-08-28 21:27:47 +02:00
parent a32dd0c5da
commit 38959d0639

13
say.sh
View File

@@ -218,12 +218,13 @@ elif [ "$1" = "install" ]; then
sudo apt-get install libttspico-utils sox zenity xsel;
fi
elif [ "$1" = "uninstall" ]; then
#if [ "`grep -rnw $HOME/.bashrc -e \". $SRCPATH\"`" > /dev/null ]; then
# cat "$HOME/.bashrc" | grep -v "$SRCPATH" > ~/.bashrc
# echo "Script autoload instruction removed from $HOME/.bashrc"
# source "$HOME/.bashrc"
# echo "Reloaded source: $HOME/.bashrc"
#fi
if [ "`grep -rnw $HOME/.bashrc -e \". $SRCPATH\"`" > /dev/null ]; then
test=`cat "$HOME/.bashrc" | grep -v ". $SRCPATH"`
echo "$test" > ~/.bashrc
echo "Script autoload instruction removed from $HOME/.bashrc"
source "$HOME/.bashrc"
echo "Reloaded source: $HOME/.bashrc"
fi
if [ -d "$ROOTPATH" ]; then
rm -rf "$ROOTPATH"
echo "Directory removed: $ROOTPATH"