#!/bin/sh exec 2>&1 count=10 while ! ping -c1 8.8.8.8; do sleep 1 count=$((count-1)) if [ $count -eq 0 ]; then exit 1 fi done exit 0