#!/bin/ksh
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r714 src/43haes/usr/sbin/cluster/cspoc/utilities/clsyncjfslog.sh 1.1 
#  
# Licensed Materials - Property of IBM 
#  
# Restricted Materials of IBM 
#  
# COPYRIGHT International Business Machines Corp. 1999 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)25  1.1  src/43haes/usr/sbin/cluster/cspoc/utilities/clsyncjfslog.sh, hacmp.cspoc, 61haes_r714 12/23/99 11:36:54

VGNAME=$1
LOG_LV=$2

varied_on=false
if [[ -z $(lsvg -o | grep $VGNAME) ]]; then
    varyonvg $VGNAME
    if [[ $? -ne 0 ]]; then
        exit 1
    fi
    varied_on=true
fi
synclvodm $VGNAME $LOG_LV
if [[ $? -ne 0 ]]; then
    exit 1
fi

if [[ "$varied_on" = "true" ]]; then
    varyoffvg $VGNAME
    if [[ $? -ne 0 ]]; then
        exit 1
    fi
fi

exit 0
