linux script to test connectivity IP -



linux script to test connectivity IP -

any thought how create script in order test connectivity ip represents default gateway. , in case of connectivity, print message "default gateway up" , if it's not connected give message "default gateway down"

#!/bin/bash ping -c 1 192.168.1.1 2>&1 > /dev/null if [ $? -ne 0 ] echo -e "host not respond ping" fi

put script in crontab , allow run every min or whatever frequency want.

linux

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

r - url in CRAN extension manual -

asp.net - .NET Control.ID property inconsistency -