From eb3243ba6bfa9e321fcd882282ecc695fd5b999e Mon Sep 17 00:00:00 2001 From: Alex Epstein Date: Mon, 26 Jun 2017 19:57:39 -0400 Subject: [PATCH] Added installers and uninstallers to scripts --- currency/{currency.sh => currency} | 1 - currency/install.sh | 6 ++++++ currency/uninstall.sh | 5 +++++ install.sh | 10 ++++++++++ stocks/install.sh | 6 ++++++ stocks/{stocks.sh => stocks} | 1 - stocks/uninstall.sh | 5 +++++ uninstall.sh | 10 ++++++++++ weather/install.sh | 6 ++++++ weather/uninstall.sh | 5 +++++ weather/{weather.sh => weather} | 1 - 11 files changed, 53 insertions(+), 3 deletions(-) rename currency/{currency.sh => currency} (99%) create mode 100755 currency/install.sh create mode 100755 currency/uninstall.sh create mode 100755 install.sh create mode 100755 stocks/install.sh rename stocks/{stocks.sh => stocks} (99%) create mode 100755 stocks/uninstall.sh create mode 100755 uninstall.sh create mode 100755 weather/install.sh create mode 100755 weather/uninstall.sh rename weather/{weather.sh => weather} (99%) diff --git a/currency/currency.sh b/currency/currency similarity index 99% rename from currency/currency.sh rename to currency/currency index f219e79..6c92bc3 100755 --- a/currency/currency.sh +++ b/currency/currency @@ -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 diff --git a/currency/install.sh b/currency/install.sh new file mode 100755 index 0000000..9378180 --- /dev/null +++ b/currency/install.sh @@ -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" diff --git a/currency/uninstall.sh b/currency/uninstall.sh new file mode 100755 index 0000000..fb5c73a --- /dev/null +++ b/currency/uninstall.sh @@ -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" diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..e949d20 --- /dev/null +++ b/install.sh @@ -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 diff --git a/stocks/install.sh b/stocks/install.sh new file mode 100755 index 0000000..29adc6f --- /dev/null +++ b/stocks/install.sh @@ -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" diff --git a/stocks/stocks.sh b/stocks/stocks similarity index 99% rename from stocks/stocks.sh rename to stocks/stocks index c4a7656..cda23c1 100755 --- a/stocks/stocks.sh +++ b/stocks/stocks @@ -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 diff --git a/stocks/uninstall.sh b/stocks/uninstall.sh new file mode 100755 index 0000000..5572cb4 --- /dev/null +++ b/stocks/uninstall.sh @@ -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" diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..ec6b920 --- /dev/null +++ b/uninstall.sh @@ -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 diff --git a/weather/install.sh b/weather/install.sh new file mode 100755 index 0000000..ea06da9 --- /dev/null +++ b/weather/install.sh @@ -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" diff --git a/weather/uninstall.sh b/weather/uninstall.sh new file mode 100755 index 0000000..a77efd4 --- /dev/null +++ b/weather/uninstall.sh @@ -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" diff --git a/weather/weather.sh b/weather/weather similarity index 99% rename from weather/weather.sh rename to weather/weather index 24b82b5..45f6386 100755 --- a/weather/weather.sh +++ b/weather/weather @@ -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