Changeset 3775 in /cluster/svnroot


Ignore:
Timestamp:
Jul 28, 2012 8:52:36 PM (8 years ago)
Author:
skylar
Message:

make sure head node hostname only shows up once (#480)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/skylar/bccd-3.1.1/trees/bin/bccd-snarfhosts

    r3773 r3775  
    7878if [[ ${STAGE} = "LIVE" ]]; then
    7979        DIR=/tmp/bccd/
    80         NODES=$(find ${DIR} -mindepth 1 -maxdepth 1|grep -v \`hostname\`|sed -e "s!^${DIR}!!g")
    81         NODES="$(hostname) ${NODES}"
     80        NODES=$(find ${DIR} -mindepth 1 -maxdepth 1|sed -e "s%^${DIR}%%g")
     81        # Make sure my hostname is included
     82        if echo ${NODES} | grep -qv $(hostname); then
     83                NODES="$(hostname) ${NODES}"
     84        fi
    8285elif [[ ${STAGE} = "LIBERATED" ]]; then
    8386        DIR=/bccd/home/meta/nodes/
    84         NODES=$(find ${DIR} -type f -cmin -2 -exec basename {} \;|grep -v node000)
    85         NODES="node000 ${NODES}"
     87        NODES=$(find ${DIR} -type f -cmin -2 -exec basename {} \;)
     88        # Make sure node000 is included
     89        if echo ${NODES} | grep -qv node000; then
     90                NODES="node000 ${NODES}"
     91        fi
    8692fi
    8793# Verify lock file is ours before continuing
Note: See TracChangeset for help on using the changeset viewer.