#!/bin/sh

if [ "$(ping -c 1 -w 1 -s 1 8.8.8.8 2>&1 | grep -c "\bunreachable\b")" -eq "0" ] ; then
    echo "Internet connection is established."
else
    echo "No internet connection."
    exit 1
fi

