Created
May 21, 2016 08:07
-
-
Save spot62/6a8651b7956ca7da90780a2d49d5696d to your computer and use it in GitHub Desktop.
Checking interface working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IFACE_NAME="p2p1" | |
IFACE_IP="192.168.1.1" | |
RES=`ping -I ${IFACE_NAME} ${IFACE_IP} -c 3 | grep "100%" |wc -l` | |
if ! [ ${RES} -ne "1" ]; | |
then | |
echo "${IFACE_NAME} is not working" | |
else | |
echo "${IFACE_NAME} is working" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment