2
0
mirror of https://github.com/alexanderepstein/Bash-Snippets synced 2018-11-08 02:59:35 +01:00

Removed duplicate checkInternet() func in ytview (#37)

This commit is contained in:
Charles Arnaudo 2017-07-05 10:11:50 -04:00 committed by Alex Epstein
parent e1c89005fd
commit 0e70ea9e95

View File

@ -45,20 +45,6 @@ httpGet()
esac
}
checkInternet()
{
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1 # query google with a get request
if [ $? -eq 0 ]; then #check if the output is 0, if so no errors have occured and we have connected to google successfully
return 0
else
echo "Error: no active internet connection" >&2 #sent to stderr
return 1
fi
}
update()
{
# Author: Alexander Epstein https://github.com/alexanderepstein