#! /bin/bash
cyflexlogevent -t generic -m 1 -m "script" -m "$0" 

#
# Script name: generate_password_file
#
# Purpose: Generate a file containing a password on an encrypted,
# binary format.  Programs may then use this file to check user
# entered passwords.
#
# Invoking argument:
#   1 - Password to be encrypted and stored in the file.
#
# Output: 
#    A file, password.bin, containing the encrypted, binary password.
#
# History:
#    01/10/11 - Rob Janes - Initial release
#

# Validate that there's a comment line argument.
if (( $# != 1)) ; then
   echo Usage: generate_password_file  PASSWORD
   exit 1
fi

. configure_java

export CLASSPATH=$GUI/specfilegui.jar:$D3/protobuf.jar

PROPS=-DPropertiesFile=$CELL/cui_properties.txt
java $PROPS com.cybermetrix.cyflex.utilities.PasswordFileCheck $1
