#!/bin/sh
#
#
#    Copyright (c) 1996-2006 Brocade Communications Systems, Inc.
#    All rights reserved.
#
# NAME
#      licenseremove - remove the license from database
#
# SYNOPSIS
#      licenseremove license
#
# AVAILABILITY
#      admin
#
# DESCRIPTION
#      This  command removes licenses from the database. Some licenses need
#      reboot to make them affective.Switchenable/switchdisable will
#      be enough for few licenses to make them affective.
#
# OPTIONS
#      license   license that need to be removed from database.
#
# EXAMPLES
#      > licenseremove "Sy9RRcyby9T0ASSG"
#      removing license-key "Sy9RRcyby9T0ASSG"
#

# Check RBAC permission on command
/fabos/libexec/rbac_check `/bin/basename $0`

if [ $? -ne 0 ]; then
	exit 127
fi

if [ $# -lt 1 ]; then
    echo "Usage: `//bin/basename $0` \"license-key\""
    exit 1;
fi

case $1 in
-h)
    echo "Usage: licenseremove \"license-key\""
    exit 1
    ;;
esac

/fabos/libexec/lutil -vr $@
