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

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

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