implementation de l'operation uninstall

This commit is contained in:
jhechavarria
2018-08-23 13:31:41 +02:00
parent 25fb25abf5
commit 03c3fa88de

30
say.sh
View File

@@ -182,7 +182,18 @@ say ()
play $SNDPATH vol ${cfg[1]} speed ${cfg[2]}; play $SNDPATH vol ${cfg[1]} speed ${cfg[2]};
} }
if [[ "$1" = "install" ]]; then # Script related instructions
if [ "$1" = "config" ]; then
saycfg $2 $3 $4;
elif [ "$1" = "gui" ]; then
saygui $2;
elif [ "$1" = "say" ]; then
if [ "`pgrep -x play`" > /dev/null ]; then
shutup;
else
say "`xsel`" ;
fi
elif [ "$1" = "install" ]; then
if [ ! -d "$ROOTPATH" ]; then if [ ! -d "$ROOTPATH" ]; then
mkdir -p $ROOTPATH mkdir -p $ROOTPATH
echo "Created directory: $ROOTPATH" echo "Created directory: $ROOTPATH"
@@ -206,14 +217,11 @@ if [[ "$1" = "install" ]]; then
if [ "$2" = "-d" ]; then if [ "$2" = "-d" ]; then
sudo apt-get install libttspico-utils sox zenity xsel; sudo apt-get install libttspico-utils sox zenity xsel;
fi fi
elif [ "$1" = "config" ]; then elif [ "$1" = "uninstall" ]; then
saycfg $2 $3 $4; cat "$HOME/.bashrc" | grep -v "$SRCPATH" > ~/.bashrc
elif [ "$1" = "gui" ]; then echo "Script autoload instruction removed from $HOME/.bashrc"
saygui $2; source "$HOME/.bashrc"
elif [ "$1" = "say" ]; then echo "Reloaded source: $HOME/.bashrc"
if [ "`pgrep -x play`" > /dev/null ]; then rm -rf "$ROOTPATH"
shutup; echo "Directory removed: $ROOTPATH"
else
say "`xsel`" ;
fi
fi fi