Test if script was installed before asking to uninstall
This commit is contained in:
parent
d333b5bcf3
commit
a0e0eebc30
19
uninstall.sh
19
uninstall.sh
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
||||
|
||||
|
||||
if [[ -f /usr/local/bin/currency ]];then
|
||||
echo -n "Do you wish to uninstall currency [Y/n]: "
|
||||
read -r answer
|
||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||
|
@ -9,8 +9,10 @@ if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
|||
./uninstall.sh || exit 1
|
||||
cd .. || exit 1
|
||||
fi
|
||||
|
||||
unset answer
|
||||
fi
|
||||
|
||||
if [[ -f /usr/local/bin/stocks ]];then
|
||||
echo -n "Do you wish to uninstall stocks [Y/n]: "
|
||||
read -r answer
|
||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||
|
@ -19,8 +21,10 @@ if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
|||
cd .. || exit 1
|
||||
|
||||
fi
|
||||
|
||||
unset answer
|
||||
fi
|
||||
|
||||
if [[ -f /usr/local/bin/weather ]];then
|
||||
echo -n "Do you wish to uninstall weather [Y/n]: "
|
||||
read -r answer
|
||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||
|
@ -29,8 +33,10 @@ if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
|||
cd .. || exit 1
|
||||
|
||||
fi
|
||||
|
||||
unset answer
|
||||
fi
|
||||
|
||||
if [[ -f /usr/local/bin/crypt ]];then
|
||||
echo -n "Do you wish to uninstall crypt [Y/n]: "
|
||||
read -r answer
|
||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||
|
@ -39,8 +45,10 @@ if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
|||
cd .. || exit 1
|
||||
|
||||
fi
|
||||
|
||||
unset answer
|
||||
fi
|
||||
|
||||
if [[ -f /usr/local/bin/movies ]];then
|
||||
echo -n "Do you wish to uninstall movies [Y/n]: "
|
||||
read -r answer
|
||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||
|
@ -48,3 +56,4 @@ if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
|||
./uninstall.sh
|
||||
cd .. || exit 1
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue