Changeset 5003 in genesis
- Timestamp:
- Nov 5, 2005, 11:59:44 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/config-node.sh
r5001 r5003 199 199 url=$1 200 200 file=$2 201 ${FETCH} -o - ${ link}${nodename} > ${TMPPREFIX}.x \201 ${FETCH} -o - ${url} > ${TMPPREFIX}.x \ 202 202 || cleanexit 1 203 203 … … 213 213 fi 214 214 215 cp ${TMPPREFIX}.x ${ dir}/${list} \215 cp ${TMPPREFIX}.x ${file} \ 216 216 || cleanexit 1 217 217 rm -f ${TMPPREFIX}.x … … 223 223 { 224 224 log Fetching list of nodes from ${link} 225 ${FETCH} -o - ${link} >${nlist} || cleanexit 1225 safefetch ${link} ${nlist} || cleanexit 1 226 226 } 227 227 … … 255 255 do_diff() { 256 256 if test -e $lcd/$1; then 257 diff -uwbB $lcd/$1 $ 1.new257 diff -uwbB $lcd/$1 $dir/$1.new 258 258 else 259 259 echo Warning: $lcd/$1 does not yet exist - no DIFF … … 262 262 263 263 do_move() { 264 if [ -e$1 ]; then265 mv $1$1.bak || cleanexit 1266 fi267 cp $1.new$1 || cleanexit 1268 rm$1.new || cleanexit 1264 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 269 269 } 270 270 … … 276 276 echo "** $CMD $*" 277 277 else 278 $CMD $ dir/$file || exit 1278 $CMD $file || exit 1 279 279 fi 280 280 … … 291 291 trap "rm -f ${TMPPREFIX}.?; echo Failed; exit 1;" 2 3 292 292 293 if [ ${PRETEND} != 'yes' ]; then293 if [ ${PRETEND} != 'yes' -a ${CMD} != 'do_diff' ]; then 294 294 if mount | grep "on / " | grep -q read-only; then 295 295 if [ ${FORCE} = "yes" ]; then … … 322 322 log Checking if ${HOST} can be reached 323 323 ping -qnoc 1 ${HOST} > /dev/null || exit 1 324 log Connection OK324 log Connection: Ok 325 325 exit 0 326 326 ) || connset … … 363 363 done 364 364 365 log Checking release and OS versions366 367 safefetch ${link}${nodename}/info > $dir/${i}\365 lognlr "Checking release and OS versions: " 366 367 safefetch ${link}${nodename}/info $dir/info.last \ 368 368 || cleanexit 1 369 369 370 370 OS=`uname -s` 371 371 REL=`uname -r` 372 set `head -1 $dir/${i} 372 set -- `head -1 $dir/info.last` 373 373 374 # FreeBSD 5.0-RELEASE 1 YES 374 375 if [ $# != 4 ]; then … … 376 377 cleanexit 1 377 378 fi 378 if [ $4 -ne 'YES' ]; then379 if [ x$4 != 'xYES' ]; then 379 380 echo Genesis marked as disabled for this machine. 380 381 test -z ${DLV} || cleanexit 1 381 382 fi 382 if [ $3 -ne $VERSION_MAJOR']; then383 if [ 0$3 -ne $VERSION_MAJOR ]; then 383 384 echo This script is version $VERSION, genesis info is for version $3.xx 384 385 test -z ${DLV} || cleanexit 1 385 386 fi 386 if [ $1 -ne$OS ]; then387 if [ x$1 != x$OS ]; then 387 388 echo Operating system mismatch; this machine: $OS, but config is for $1 388 389 test -z ${DLV} || cleanexit 1 389 390 fi 390 if [ $2 -ne$REL ]; then391 if [ x$2 != x$REL ]; then 391 392 echo This machine runs $REL, but the configuration is for $2 392 393 test -z ${DLV} || cleanexit 2 393 394 fi 395 396 log Ok 394 397 395 398 log Fetching file list from $link for $nodename … … 401 404 do 402 405 lognlr " ${i}" 403 $FETCH -o - ${link}${nodename}/${i} > ${dir}/${i}.new \ 404 || cleanexit 1406 # $FETCH -o - ${link}${nodename}/${i} > ${dir}/${i}.new || cleanexit 1 407 safefetch ${link}${nodename}/${i} ${dir}/${i}.new 405 408 done 406 409 log . … … 469 472 fi 470 473 471 if [ -r /etc/namedb/make-localhost ]; then474 if [ -r /etc/namedb/make-localhost -a ${CMD} != 'do_diff' ]; then 472 475 ( 473 476 cd /etc/namedb || exit 1
Note:
See TracChangeset
for help on using the changeset viewer.