The script searches for active interfaces and returns the correct value except I want to also add a statement in there that returns "No active interfaces found" if there are truly no active interfaces.. having trouble adding an if/else statement in here? Any suggestions?
#!/bin/sh
for iface in `ifconfig -lu` ; do
case $iface in
lo*) continue ;;
esac
ifconfig $iface | grep -q 'inet ' && echo $iface
done
#!/bin/sh
for iface in `ifconfig -lu` ; do
case $iface in
lo*) continue ;;
esac
ifconfig $iface | grep -q 'inet ' && echo $iface
done