mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
Using github for check internet
This commit is contained in:
parent
2f007ecb1d
commit
a5fdff610c
@ -40,7 +40,7 @@ httpGet()
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
update()
|
update()
|
||||||
|
@ -37,7 +37,7 @@ httpGet()
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
update()
|
update()
|
||||||
|
@ -158,7 +158,7 @@ checkAmount()
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
## Grabs the exchange rate and does the math for converting the currency
|
## Grabs the exchange rate and does the math for converting the currency
|
||||||
|
@ -130,7 +130,7 @@ checkAmount()
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
## Grabs the exchange rate and does the math for converting the currency
|
## Grabs the exchange rate and does the math for converting the currency
|
||||||
|
@ -40,7 +40,7 @@ httpGet()
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
update()
|
update()
|
||||||
|
2
geo/geo
2
geo/geo
@ -173,7 +173,7 @@ update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkInternet() {
|
checkInternet() {
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
# Option parsing "controller"
|
# Option parsing "controller"
|
||||||
|
@ -58,7 +58,7 @@ fi
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
## This function grabs information about a movie and using python parses the
|
## This function grabs information about a movie and using python parses the
|
||||||
|
@ -37,7 +37,7 @@ httpGet()
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ makeMultiLineQr()
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
|
@ -59,7 +59,7 @@ fi
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
update()
|
update()
|
||||||
|
@ -99,7 +99,7 @@ EOF
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
checkCiphers()
|
checkCiphers()
|
||||||
|
@ -57,7 +57,7 @@ fi
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
## This function grabs information about a stock and using python parses the
|
## This function grabs information about a stock and using python parses the
|
||||||
|
@ -61,7 +61,7 @@ fi
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
update()
|
update()
|
||||||
|
@ -83,7 +83,7 @@ addTask()
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
removeTask()
|
removeTask()
|
||||||
|
@ -56,7 +56,7 @@ getLocationWeather()
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
update()
|
update()
|
||||||
|
@ -39,7 +39,7 @@ httpGet()
|
|||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
{
|
{
|
||||||
httpGet google.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
|
||||||
}
|
}
|
||||||
|
|
||||||
update()
|
update()
|
||||||
|
Loading…
Reference in New Issue
Block a user