mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
Added installers and uninstallers to scripts
This commit is contained in:
parent
fa881976af
commit
eb3243ba6b
@ -54,7 +54,6 @@ getAmount()
|
|||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
|
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
6
currency/install.sh
Executable file
6
currency/install.sh
Executable 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
5
currency/uninstall.sh
Executable 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
10
install.sh
Executable 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
6
stocks/install.sh
Executable 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"
|
@ -3,7 +3,6 @@
|
|||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
|
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
5
stocks/uninstall.sh
Executable file
5
stocks/uninstall.sh
Executable 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
10
uninstall.sh
Executable 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
6
weather/install.sh
Executable 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
5
weather/uninstall.sh
Executable 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"
|
@ -17,7 +17,6 @@ fi
|
|||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
echo "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
|
echo "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
Loading…
Reference in New Issue
Block a user