mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
Test if script was installed before asking to uninstall
This commit is contained in:
parent
d333b5bcf3
commit
a0e0eebc30
79
uninstall.sh
79
uninstall.sh
@ -1,50 +1,59 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# Author: Alexander Epstein https://github.com/alexanderepstein
|
||||||
|
|
||||||
|
if [[ -f /usr/local/bin/currency ]];then
|
||||||
echo -n "Do you wish to uninstall currency [Y/n]: "
|
echo -n "Do you wish to uninstall currency [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
cd currency || exit 1
|
cd currency || exit 1
|
||||||
./uninstall.sh || exit 1
|
./uninstall.sh || exit 1
|
||||||
cd .. || exit 1
|
cd .. || exit 1
|
||||||
|
fi
|
||||||
|
unset answer
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset answer
|
if [[ -f /usr/local/bin/stocks ]];then
|
||||||
echo -n "Do you wish to uninstall stocks [Y/n]: "
|
echo -n "Do you wish to uninstall stocks [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
cd stocks || exit 1
|
cd stocks || exit 1
|
||||||
./uninstall.sh
|
./uninstall.sh
|
||||||
cd .. || exit 1
|
cd .. || exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
unset answer
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset answer
|
if [[ -f /usr/local/bin/weather ]];then
|
||||||
echo -n "Do you wish to uninstall weather [Y/n]: "
|
echo -n "Do you wish to uninstall weather [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
cd weather || exit 1
|
cd weather || exit 1
|
||||||
./uninstall.sh
|
./uninstall.sh
|
||||||
cd .. || exit 1
|
cd .. || exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
unset answer
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset answer
|
if [[ -f /usr/local/bin/crypt ]];then
|
||||||
echo -n "Do you wish to uninstall crypt [Y/n]: "
|
echo -n "Do you wish to uninstall crypt [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
cd crypt || exit 1
|
cd crypt || exit 1
|
||||||
./uninstall.sh
|
./uninstall.sh
|
||||||
cd .. || exit 1
|
cd .. || exit 1
|
||||||
|
|
||||||
|
fi
|
||||||
|
unset answer
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset answer
|
if [[ -f /usr/local/bin/movies ]];then
|
||||||
echo -n "Do you wish to uninstall movies [Y/n]: "
|
echo -n "Do you wish to uninstall movies [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
cd movies || exit 1
|
cd movies || exit 1
|
||||||
./uninstall.sh
|
./uninstall.sh
|
||||||
cd .. || exit 1
|
cd .. || exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user