securisation de l'instruction uninstall

This commit is contained in:
jhechavarria
2018-08-24 00:48:05 +02:00
parent 1f4b790b36
commit 6f4283e549

8
say.sh
View File

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