All pastes #432011 Raw Edit

Anonymous

public shellscript v1 · immutable
·published 2007-04-10 00:31 UTC
rendered paste body
# Set WAN_IP by preferences in this order: argument 1, DHCP info, or static entryif [[ $# -lt 1 ]] ; then        # No IP was passed, so try to get it ourselves        if ! WAN_IP=`grep IPADDR /var/lib/dhcpc/dhcpcd-eth1.info | grep -Eo "[0-9]{1,3}(\.[0-9]{1,3}){3}"` ; then                # Unable to get IP, so use a hard-coded default as a fallback                WAN_IP="24.118.122.48"                echo "${name} WARNING: using hard-coded default for WAN_IP"        fielse        # An IP was passed, so use it        WAN_IP=$1fiecho "${name} Using WAN_IP of ${WAN_IP}"