Adding geo install and uninstall, fixing incorrect echo in uninstall
This commit is contained in:
parent
14e9a60623
commit
71a2704216
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Author: Alexander Epstein https://github.com/alexanderepstein
|
||||||
|
echo -n "Installing geo: "
|
||||||
|
chmod a+x geo
|
||||||
|
cp geo /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
|
||||||
|
echo "Success"
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Author: Alexander Epstein https://github.com/alexanderepstein
|
||||||
|
echo -n "Removing geo: "
|
||||||
|
rm -f /usr/local/bin/geo > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
|
||||||
|
echo "Success"
|
22
install.sh
22
install.sh
|
@ -69,6 +69,16 @@ if [[ $# == 0 ]]; then
|
||||||
cd .. || exit 1
|
cd .. || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
unset answer
|
||||||
|
echo -n "Do you wish to install geo [Y/n]: "
|
||||||
|
read -r answer
|
||||||
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
|
cd geo || exit 1
|
||||||
|
./install.sh
|
||||||
|
cd .. || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $1 == "currency" ]];then
|
if [[ $1 == "currency" ]];then
|
||||||
|
@ -99,6 +109,10 @@ elif [[ $1 == "short" ]]; then
|
||||||
cd short || exit 1
|
cd short || exit 1
|
||||||
./install.sh || exit 1
|
./install.sh || exit 1
|
||||||
cd .. || exit 1
|
cd .. || exit 1
|
||||||
|
elif [[ $1 == "geo" ]]; then
|
||||||
|
cd geo || exit 1
|
||||||
|
./install.sh || exit 1
|
||||||
|
cd .. || exit 1
|
||||||
elif [[ $1 == "all" ]];then
|
elif [[ $1 == "all" ]];then
|
||||||
cd currency || exit 1
|
cd currency || exit 1
|
||||||
./install.sh || exit 1
|
./install.sh || exit 1
|
||||||
|
@ -121,6 +135,9 @@ elif [[ $1 == "all" ]];then
|
||||||
cd short || exit 1
|
cd short || exit 1
|
||||||
./install.sh || exit 1
|
./install.sh || exit 1
|
||||||
cd .. || exit 1
|
cd .. || exit 1
|
||||||
|
cd geo || exit 1
|
||||||
|
./install.sh || exit 1
|
||||||
|
cd .. || exit 1
|
||||||
elif [[ $1 == "update" ]]; then
|
elif [[ $1 == "update" ]]; then
|
||||||
echo "Updating scripts..."
|
echo "Updating scripts..."
|
||||||
if [[ -f /usr/local/bin/currency ]];then
|
if [[ -f /usr/local/bin/currency ]];then
|
||||||
|
@ -158,6 +175,11 @@ elif [[ $1 == "update" ]]; then
|
||||||
./install.sh || exit 1
|
./install.sh || exit 1
|
||||||
cd .. || exit 1
|
cd .. || exit 1
|
||||||
fi
|
fi
|
||||||
|
if [[ -f /usr/local/bin/geo ]];then
|
||||||
|
cd geo || exit 1
|
||||||
|
./install.sh || exit 1
|
||||||
|
cd .. || exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Bash Snippets version $currentVersion"
|
echo "Bash Snippets version $currentVersion"
|
||||||
|
|
14
uninstall.sh
14
uninstall.sh
|
@ -59,7 +59,7 @@ if [[ -f /usr/local/bin/movies ]];then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f /usr/local/bin/taste ]];then
|
if [[ -f /usr/local/bin/taste ]];then
|
||||||
echo -n "Do you wish to uninstall movies [Y/n]: "
|
echo -n "Do you wish to uninstall taste [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
cd taste || exit 1
|
cd taste || exit 1
|
||||||
|
@ -69,7 +69,7 @@ if [[ -f /usr/local/bin/taste ]];then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f /usr/local/bin/short ]];then
|
if [[ -f /usr/local/bin/short ]];then
|
||||||
echo -n "Do you wish to uninstall movies [Y/n]: "
|
echo -n "Do you wish to uninstall short [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
cd short || exit 1
|
cd short || exit 1
|
||||||
|
@ -77,3 +77,13 @@ if [[ -f /usr/local/bin/short ]];then
|
||||||
cd .. || exit 1
|
cd .. || exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -f /usr/local/bin/geo ]];then
|
||||||
|
echo -n "Do you wish to uninstall geo [Y/n]: "
|
||||||
|
read -r answer
|
||||||
|
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||||
|
cd geo || exit 1
|
||||||
|
./uninstall.sh
|
||||||
|
cd .. || exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue