Changeset 5969632


Ignore:
Timestamp:
06/17/14 07:02:16 (9 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1
Children:
eaea8ff
Parents:
33ffb94
Message:

Fix lpreserver status to display properly if no replication is enabled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/lpreserver/backend/functions.sh

    r65ea581 r5969632  
    403403    echo "---------------------------------------------------" 
    404404 
     405    REPHOST="NONE" 
     406    lastSNAP="NONE" 
     407    lastSEND="NONE" 
     408    lastSNAP=`zfs list -t snapshot -d 1 -H ${i} | tail -1 | awk '{$1=$1}1' OFS=" " | cut -d '@' -f 2 | cut -d ' ' -f 1` 
     409 
     410    cat ${REPCONF} | grep -q "^${i}:" 
     411    if [ $? -ne 0 ] ; then 
     412       echo "$i -> $REPHOST - $lastSNAP - $lastSEND" 
     413       continue 
     414    fi 
     415 
    405416    # Get some details about this host 
    406417    for repLine in `cat ${REPCONF} | grep "^${i}:"` 
     
    409420 
    410421      lastSEND=`zfs get -d 1 lpreserver:${REPHOST} ${i} | grep LATEST | awk '{$1=$1}1' OFS=" " | tail -1 | cut -d '@' -f 2 | cut -d ' ' -f 1` 
    411       lastSNAP=`zfs list -t snapshot -d 1 -H ${i} | tail -1 | awk '{$1=$1}1' OFS=" " | cut -d '@' -f 2 | cut -d ' ' -f 1` 
    412422 
    413423      if [ -z "$lastSEND" ] ; then lastSEND="NONE"; fi 
Note: See TracChangeset for help on using the changeset viewer.