#!/bin/sh
#
#
#    Copyright (c) 1996-2006 Brocade Communications Systems, Inc.
#    All rights reserved.
#
# NAME
#      licenseadd - Add the license to database
# 
# SYNOPSIS
#      licenseadd license
# 
# AVAILABILITY
#      admin
# 
# DESCRIPTION
#      This  command adds licenses to 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 added to database.
# 
# EXAMPLES
#      > licenseadd "Sy9RRcyby9T0ASSG"
#      adding 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: licenseadd \"license-key\""
    exit 1
    ;;
esac

/fabos/libexec/lutil -va $@
