GenerateNewPubPrivKeys.sh 729 Bytes
#!/bin/sh

usage="
    \n ### Generate new public / private keys for DDService###
    \n
    \n    Usage : $0 -d <Client description>
    \n
    \n            $0 -d \"AMDA Dev instance\"
    \n
    \n
    \n ###"

while getopts "d:h" options; do
    case $options in
        d ) CLIENT_DESCRIPTION=`echo $OPTARG`;;
        h ) echo -e $usage
            exit 1;;
        \? ) echo -e $usage
            exit 1;;
        * ) echo -e $usage
            exit 1;;
    esac
done

if [ "$CLIENT_DESCRIPTION" = "" ]
then
    echo "[ERROR] Missing client description"
    echo -e $usage
    exit 1
fi

BASEDIR=$(dirname "$0")

. ${BASEDIR}/DDServer.env

php ${USERMANAGER}/GenerateNewPubPrivKeys.php --description "$CLIENT_DESCRIPTION"