Changeset 5003 in genesis


Ignore:
Timestamp:
Nov 5, 2005, 11:59:44 PM (19 years ago)
Author:
dirkx
Message:

Checks version and diff details

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/config-node.sh

    r5001 r5003  
    199199        url=$1
    200200        file=$2
    201         ${FETCH} -o - ${link}${nodename} > ${TMPPREFIX}.x \
     201        ${FETCH} -o - ${url} > ${TMPPREFIX}.x \
    202202                    || cleanexit 1
    203203
     
    213213        fi
    214214
    215         cp ${TMPPREFIX}.x ${dir}/${list} \
     215        cp ${TMPPREFIX}.x ${file} \
    216216            || cleanexit 1
    217217        rm -f ${TMPPREFIX}.x
     
    223223{
    224224        log Fetching list of nodes from ${link}
    225         ${FETCH} -o - ${link} > ${nlist} || cleanexit 1
     225        safefetch ${link} ${nlist} || cleanexit 1
    226226}
    227227
     
    255255do_diff() {
    256256        if test -e $lcd/$1; then
    257                 diff -uwbB $lcd/$1 $1.new
     257                diff -uwbB $lcd/$1 $dir/$1.new
    258258        else
    259259                echo Warning: $lcd/$1 does not yet exist - no DIFF
     
    262262
    263263do_move() {
    264 if [ -e $1 ]; then
    265         mv $1 $1.bak  || cleanexit 1
    266 fi
    267 cp $1.new $1 || cleanexit 1
    268 rm $1.new || cleanexit 1
     264        if [ -e $dir/$1 ]; then
     265                mv $dir/$1 $dir/$1.bak  || cleanexit 1
     266        fi
     267        cp $dir/$1.new $dir/$1 || cleanexit 1
     268        rm $dir/$1.new || cleanexit 1
    269269}
    270270
     
    276276        echo "** $CMD $*"
    277277   else
    278         $CMD $dir/$file || exit 1
     278        $CMD $file || exit 1
    279279   fi
    280280
     
    291291trap "rm -f ${TMPPREFIX}.?; echo Failed; exit 1;" 2 3
    292292
    293 if [ ${PRETEND} != 'yes' ]; then
     293if [ ${PRETEND} != 'yes' -a ${CMD} != 'do_diff' ]; then
    294294        if mount | grep "on / " | grep -q read-only; then
    295295                if [ ${FORCE} = "yes" ]; then
     
    322322                log Checking if ${HOST} can be reached
    323323                ping -qnoc 1 ${HOST} > /dev/null || exit 1
    324                 log Connection OK
     324                log Connection: Ok
    325325                exit 0
    326326        ) || connset
     
    363363done
    364364
    365 log Checking release and OS versions
    366 
    367 safefetch ${link}${nodename}/info > $dir/${i} \
     365lognlr "Checking release and OS versions: "
     366
     367safefetch ${link}${nodename}/info $dir/info.last \
    368368        || cleanexit 1
    369369
    370370OS=`uname -s`
    371371REL=`uname -r`
    372 set `head -1 $dir/${i}
     372set -- `head -1 $dir/info.last`
     373
    373374# FreeBSD 5.0-RELEASE 1 YES
    374375if [ $# != 4 ]; then
     
    376377        cleanexit 1
    377378fi
    378 if [ $4 -ne 'YES' ]; then
     379if [ x$4 != 'xYES' ]; then
    379380        echo Genesis marked as disabled for this machine.
    380381        test -z ${DLV} || cleanexit 1
    381382fi
    382 if [ $3 -ne $VERSION_MAJOR' ]; then
     383if [ 0$3 -ne $VERSION_MAJOR ]; then
    383384        echo This script is version $VERSION, genesis info is for version $3.xx
    384385        test -z ${DLV} || cleanexit 1
    385386fi
    386 if [ $1 -ne $OS ]; then
     387if [ x$1 != x$OS ]; then
    387388        echo Operating system mismatch; this machine: $OS, but config is for $1
    388389        test -z ${DLV} || cleanexit 1
    389390fi
    390 if [ $2 -ne $REL ]; then
     391if [ x$2 != x$REL ]; then
    391392        echo This machine runs $REL, but the configuration is for $2
    392393        test -z ${DLV} || cleanexit 2
    393394fi
     395
     396log Ok
    394397
    395398log Fetching file list from $link for $nodename
     
    401404do
    402405  lognlr " ${i}"
    403   $FETCH -o - ${link}${nodename}/${i} > ${dir}/${i}.new \
    404     || cleanexit 1
     406#  $FETCH -o - ${link}${nodename}/${i} > ${dir}/${i}.new || cleanexit 1
     407   safefetch ${link}${nodename}/${i} ${dir}/${i}.new
    405408done
    406409log .
     
    469472fi
    470473
    471 if [ -r  /etc/namedb/make-localhost ]; then
     474if [ -r  /etc/namedb/make-localhost -a ${CMD} != 'do_diff'  ]; then
    472475  (
    473476    cd /etc/namedb || exit 1
Note: See TracChangeset for help on using the changeset viewer.