Changeset 5001 in genesis for tools


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

Config checks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/config-node.sh

    r4997 r5001  
    1515# 1.05  Cope with WHOST containing a port number. (dirkx).
    1616# 1.06  Better diff (dirkx)
     17# 1.07  Check versions of OS and Script
    1718#
    1819# If there is a global system configuration file, suck it in.
     
    3031FORCE=no
    3132CMD=do_move
     33DLV=no
    3234
    3335# Genesis master location.
     
    5759        echo "-q                Suppress all output and user interaction"
    5860        echo "-F                Force disk to write"
     61        echo "-i                Ignore all safety checks checks"
    5962        exit 1
    6063}
     
    6972                        QUIET=yes
    7073                        ;;
     74                -i)
     75                        DLV=
     76                        ;;
    7177                -d)     
    7278                        CMD=do_diff
     
    97103done
    98104
    99 
    100105HOST=`echo ${WHOST} | sed -e 's/:.*//'`
     106set `echo $VERSION | sed -e 's/\./ /'`
     107VERSION_MAJOR=$1
     108VERSION_MINOR=$2
     109VERSION_OTHER=$3
    101110
    102111# connection test function
     
    248257                diff -uwbB $lcd/$1 $1.new
    249258        else
    250                 echo Warning: $1 does not yet exist - no DIFF
     259                echo Warning: $lcd/$1 does not yet exist - no DIFF
    251260        fi
    252261}
     
    354363done
    355364
     365log Checking release and OS versions
     366
     367safefetch ${link}${nodename}/info > $dir/${i} \
     368        || cleanexit 1
     369
     370OS=`uname -s`
     371REL=`uname -r`
     372set `head -1 $dir/${i}
     373# FreeBSD 5.0-RELEASE 1 YES
     374if [ $# != 4 ]; then
     375        echo Info verification failed.
     376        cleanexit 1
     377fi
     378if [ $4 -ne 'YES' ]; then
     379        echo Genesis marked as disabled for this machine.
     380        test -z ${DLV} || cleanexit 1
     381fi
     382if [ $3 -ne $VERSION_MAJOR' ]; then
     383        echo This script is version $VERSION, genesis info is for version $3.xx
     384        test -z ${DLV} || cleanexit 1
     385fi
     386if [ $1 -ne $OS ]; then
     387        echo Operating system mismatch; this machine: $OS, but config is for $1
     388        test -z ${DLV} || cleanexit 1
     389fi
     390if [ $2 -ne $REL ]; then
     391        echo This machine runs $REL, but the configuration is for $2
     392        test -z ${DLV} || cleanexit 2
     393fi
     394
    356395log Fetching file list from $link for $nodename
    357396
Note: See TracChangeset for help on using the changeset viewer.