#Get current interface:
curint=`ip addr | grep 'state UP' | awk -F: '{print $2}' `
if [ -z "${curint}" ]; then
echo "The interface is down, please make sure you are connected to the network"
exit 0
fi
if [ -z "${curint+set}" ]; then
echo "The interface is down, please make sure you are connected to the network"
exit 0
fi
if [ -z "${curint-unset}" ]; then
echo "The interface is down, please make sure you are connected to the network"
exit 0
fi
if [ -n "${curint}" ]; then
echo "The interface ${curint} is UP"
fi