#!/bin/ksh
#
# Copyright 2002, 2003 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident    "@(#)get_version    1.1    03/09/26 SMI
#
# Returns the current version number of the firewall firmware
#
PKGBASE=$INSTALL_BASE/opt
PKGNAME=SUNWsespfd
FIREWALL_FILE=version
fv=""
while read line; do
    if print $line | grep "VERSION" > /dev/null; then
        fv=`echo $line | cut -f2 -d=`
    fi
done < $PKGBASE/$PKGNAME/$FIREWALL_FILE
if [[ -z $fv ]]; then
    echo "Version information not retrieved"
    exit 1
else
    echo $fv
fi
