1#!/bin/bash 2 3# function for connection check 4function connected { 5 ping -c 1 google.com &>/dev/null 6}