Hey everyone,
I am just trying to figure out how to embed a function in an if statement.
I have the following test script so far:
PRIMARY=192.168.1.2
SECONDARY=192.168.1.1
function checkAlive {
ping -c 1 -q $1
}
if [ checkAlive $PRIMARY -eq 0 ]
then
echo "equaled 0"
fi
This doesn't seem to work. Does anyone have any advice?