#!/bin/sh
echo "STATUS: Loading license file"

source /app/etc/app.env

if [ $1 != "" ]
then
    _path=$1;
else
    _path="/mnt/ramdisk/license"
fi

if [ ! -f $_path ]
then
    echo "ERROR: Filename $_path not found. Exiting."
    exit 1;
fi

setuidgid admin mccli --cmd "load license $_path"
rc=$?

if [ $rc -ne 0 ]
then
    echo "Error: An invalid software license was specified."
    exit 1
fi

echo "Done loading license file"
exit 0;

