Changeset 4990 in genesis for tools/config-node.sh


Ignore:
Timestamp:
Nov 2, 2005, 11:45:23 PM (19 years ago)
Author:
dirkx
Message:

+Cope with whost having port numbers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/config-node.sh

    r4989 r4990  
    1212#       file list, check node name to be valid, '-n' mode.
    1313#       make moving of final files a bit safer. (dirkx)
    14 # 1.04  Add auto read-only detection.
     14# 1.04  Add auto read-only detection. (dirkx)
     15# 1.05  Cope with WHOST containing a port number. (dirkx).
    1516#
    1617# If there is a global system configuration file, suck it in.
     
    2324HTTP_PROXY_DEFAULT=${HTTP_PROXY:-http://proxy.wleiden.net:3128}
    2425HTTP_USER_AGENT=${HTTP_USER_AGENT:-curl.faked.fetch/0.0}
    25 VERSION=1.04
     26VERSION=1.05
    2627QUIET=${QUIET:-}
    2728PRETEND=no
     
    9697
    9798
     99HOST=`echo ${WHOST} | sed -e 's/:.*//'`
    98100
    99101# connection test function
     
    130132        echo "nameserver ${resolver}" > /etc/resolv.conf
    131133
     134
    132135        for nic in `ifconfig -l`
    133136        do
     
    136139                ;;
    137140        *)
    138                 if ping -qnoc ${WHOST}; then
    139                         echo Connection on interface ${nic} ok
     141                if ping -qnoc ${HOST}; then
     142                        echo Connection on interface ${nic} to ${HOST} ok.
    140143                else
    141144                        killall dhclient
     
    241244
    242245do_diff() {
    243         diff -uwbB $1 $1.new
     246        if test -e $1; then
     247                diff -uwbB $1 $1.new
     248        else
     249                echo Warning: $1 does not yet exist - no DIFF
     250        fi
    244251}
    245252
     
    300307
    301308if [ -z ${HTTP_PROXY} ]; then
    302   (
    303     log Checking DNS for ${WHOST}
    304     host ${WHOST} > /dev/null || exit 1
    305     log Checking if ${WHOST} can be reached
    306     ping -qnoc 1 ${WHOST} > /dev/null || exit 1
    307     log Connection OK
    308     exit 0
    309   ) || connset
     309        (
     310                log Checking DNS for ${HOST}
     311                host ${HOST} > /dev/null || exit 1
     312                log Checking if ${HOST} can be reached
     313                ping -qnoc 1 ${HOST} > /dev/null || exit 1
     314                log Connection OK
     315                exit 0
     316        ) || connset
     317else
     318        log Connection not checked because there is an http proxy configured: ${HTTP_PROXY}.
    310319fi
    311320
Note: See TracChangeset for help on using the changeset viewer.