#!/bin/bash # # Check if a network interface is up, fixing if needed. # # Parameters BASENAME="`basename $0`" IFACE="$1" # Syntax check if [ -z "$IFACE" ]; then echo "usage: $BASENAME " exit 1 fi # Run if ! LANG=C LC_ALL=C ifconfig $IFACE | grep -q "inet addr:"; then ifup --force $IFACE fi