Making it easier to add new tools to installer and uninstaller

Just add the title of the tool to the array tools in install.sh and uninstall.sh
This commit is contained in:
Alex Epstein 2017-07-07 17:06:51 -04:00
parent 79272a58e7
commit b4533d163f
26 changed files with 15 additions and 140 deletions

View File

@ -1,6 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Installing cheat: "
chmod a+x cheat
cp cheat /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Removing cheat: "
rm -f /usr/local/bin/cheat > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"

View File

@ -1,6 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Installing cloudup: "
chmod a+x cloudup
cp cloudup /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Removing cloudup: "
rm -f /usr/local/bin/cloudup > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"

View File

@ -1,6 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Installing crypt: "
chmod a+x crypt
cp crypt /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Removing crypt: "
rm -f /usr/local/bin/crypt > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"

View File

@ -1,6 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Installing currency: "
chmod a+x currency
cp currency /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Removing currency: "
rm -f /usr/local/bin/currency > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"

View File

@ -1,6 +0,0 @@
#!/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"

View File

@ -1,5 +0,0 @@
#!/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"

View File

@ -9,8 +9,10 @@ askInstall()
read -r answer
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
cd $1 || return 1
chmod a+x install.sh || return 1
./install.sh || return 1
echo -n "Installing $1: "
chmod a+x $1
cp $1 /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"
cd .. || return 1
fi
}
@ -19,16 +21,20 @@ updateTool()
{
if [[ -f /usr/local/bin/$1 ]];then
cd $1 || return 1
chmod a+x install.sh || return 1
./install.sh || return 1
echo -n "Installing $1: "
chmod a+x $1
cp $1 /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"
cd .. || return 1
fi
}
singleInstall()
{
cd $1 || exit 1
chmod a+x install.sh || return 1
./install.sh || exit 1
echo -n "Installing $1: "
chmod a+x $1
cp $1 /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"
cd .. || exit 1
}

View File

@ -1,6 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Installing movies: "
chmod a+x movies
cp movies /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Removing movies: "
rm -f /usr/local/bin/movies > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"

View File

@ -1,6 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Installing qrify: "
chmod a+x qrify
cp qrify /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Removing qrify: "
rm -f /usr/local/bin/qrify > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"

View File

@ -1,6 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Installing short: "
chmod a+x short
cp short /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Removing short: "
rm -f /usr/local/bin/short > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"

View File

@ -1,6 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Installing stocks: "
chmod a+x stocks
cp stocks /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Removing stocks: "
rm -f /usr/local/bin/stocks > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"

View File

@ -1,6 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Installing taste: "
chmod a+x taste
cp taste /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Removing taste: "
rm -f /usr/local/bin/taste > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"

View File

@ -9,8 +9,9 @@ askUninstall()
read -r answer
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
cd $1 || return 1
chmod a+x uninstall.sh || return 1
./uninstall.sh || return 1
echo -n "Removing $1: "
rm -f /usr/local/bin/$1 > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"
cd .. || return 1
fi
unset answer

View File

@ -1,6 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Installing weather: "
chmod a+x weather
cp weather /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Removing weather: "
rm -f /usr/local/bin/weather > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"

View File

@ -1,6 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Installing ytview: "
chmod a+x ytview
cp ytview /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Removing ytview: "
rm -f /usr/local/bin/ytview > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"