Added installers and uninstallers to scripts

This commit is contained in:
Alex Epstein 2017-06-26 19:57:39 -04:00
parent fa881976af
commit eb3243ba6b
11 changed files with 53 additions and 3 deletions

View File

@ -54,7 +54,6 @@ getAmount()
checkInternet()
{
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
if [ $? -eq 0 ]; then
return 0
else

6
currency/install.sh Executable file
View File

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

5
currency/uninstall.sh Executable file
View File

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

10
install.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
cd currency
./install.sh || exit 1
cd ..
cd stocks
./install.sh
cd ..
cd weather
./install.sh

6
stocks/install.sh Executable file
View File

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

@ -3,7 +3,6 @@
checkInternet()
{
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
if [ $? -eq 0 ]; then
return 0
else

5
stocks/uninstall.sh Executable file
View File

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

10
uninstall.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
cd currency
./uninstall.sh || exit 1
cd ..
cd stocks
./uninstall.sh
cd ..
cd weather
./uninstall.sh

6
weather/install.sh Executable file
View File

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

5
weather/uninstall.sh Executable file
View File

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

@ -17,7 +17,6 @@ fi
checkInternet()
{
echo "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
if [ $? -eq 0 ]; then
return 0
else