diff --git a/say.sh b/say.sh index eba1829..4d39b03 100755 --- a/say.sh +++ b/say.sh @@ -218,10 +218,14 @@ elif [ "$1" = "install" ]; then sudo apt-get install libttspico-utils sox zenity xsel; fi elif [ "$1" = "uninstall" ]; then - #cat "$HOME/.bashrc" | grep -v "$SRCPATH" > ~/.bashrc - #echo "Script autoload instruction removed from $HOME/.bashrc" - source "$HOME/.bashrc" - echo "Reloaded source: $HOME/.bashrc" - rm -rf "$ROOTPATH" - echo "Directory removed: $ROOTPATH" + 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 [ -d "$ROOTPATH" ]; then + rm -rf "$ROOTPATH" + echo "Directory removed: $ROOTPATH" + fi fi