Author: rareddy
Date: 2009-07-28 13:58:26 -0400 (Tue, 28 Jul 2009)
New Revision: 1196
Modified:
trunk/build/kit-runtime/bin/keystore.bat
trunk/build/kit-runtime/bin/keystore.sh
trunk/build/kit-runtime/bin/run.bat
trunk/build/kit-runtime/bin/run.sh
trunk/build/kit-runtime/bin/shutdown.bat
trunk/build/kit-runtime/bin/shutdown.sh
Log:
TEIID-702: Added script comments and better script usage messages
Modified: trunk/build/kit-runtime/bin/keystore.bat
===================================================================
--- trunk/build/kit-runtime/bin/keystore.bat 2009-07-27 21:20:17 UTC (rev 1195)
+++ trunk/build/kit-runtime/bin/keystore.bat 2009-07-28 17:58:26 UTC (rev 1196)
@@ -1,7 +1,15 @@
@echo off
-rem
-rem This script file encrypts the passed in clear text and spits out encypted form
-rem
+rem ==================================================================================
###
+rem This script helps in creating a security key for encrypting
###
+rem passwords and also helps in converting a clear text password into a
###
+rem encrypted one. For more information on how to use encrypted passwords please
###
+rem check out
https://www.jboss.org/community/wiki/EncryptingpasswordsinTeiid
###
+rem
###
+rem usage: keystore.bat [options]
###
+rem options:
###
+rem -c, --create Creates security key "teiid.keystore" file in the deploy
directory ###
+rem -e, --encrypt <password> Encrypts the clear text password into encrypted form
###
+rem ==================================================================================
###
@if not "%ECHO%" == "" echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal
@@ -34,38 +42,49 @@
set
TEIID_CLASSPATH=%TEIID_HOME%\lib\patches\*;%TEIID_HOME%\deploy;%TEIID_HOME%\client\*;%TEIID_HOME%\lib\*;
set KEYSTORE_FILE=%TEIID_HOME%\deploy\teiid.keystore
-if "x%1%" == "x" (
- goto prompt
-) else (
- if "%1%" == "-create" (
- if not exist %KEYSTORE_FILE% (
- "%JAVA%" -classpath "%TEIID_CLASSPATH%"
com.metamatrix.common.util.crypto.CryptoUtil -genkey %KEYSTORE_FILE%
- echo A new key with keystore generated at %KEYSTORE_FILE%
+if "%1%" == "--create" (
+ goto create
+)
+if "%1%" == "-c" (
+ goto create
+)
+if "%1%" == "--encrypt" (
+ goto encrypt
+)
+if "%1%" == "-e" (
+ goto encrypt
+)
+goto prompt
+
+:create
+ if not exist %KEYSTORE_FILE% (
+ "%JAVA%" -classpath "%TEIID_CLASSPATH%"
com.metamatrix.common.util.crypto.CryptoUtil -genkey %KEYSTORE_FILE%
+ echo A new key with keystore generated at %KEYSTORE_FILE%
+ ) else (
+ echo %KEYSTORE_FILE% already exists. Delete the current one if you would like to create
a new keystore.
+ )
+goto end
+
+:encrypt
+ if NOT "x%2%" == "x" (
+ if exist %KEYSTORE_FILE% (
+ "%JAVA%" -classpath "%TEIID_CLASSPATH%"
com.metamatrix.common.util.crypto.CryptoUtil -key %KEYSTORE_FILE% -encrypt %2%
) else (
- echo %KEYSTORE_FILE% already exists. Delete the current one if you would like to
create a new keystore.
- )
+ echo %KEYSTORE_FILE% not found. Create a security key by using
+ echo usage:%0% --create
+ )
) else (
- if "%1%" == "-encrypt" (
- if NOT "x%2%" == "x" (
- if exist %KEYSTORE_FILE% (
- "%JAVA%" -classpath "%TEIID_CLASSPATH%"
com.metamatrix.common.util.crypto.CryptoUtil -key %KEYSTORE_FILE% -encrypt %2%
- ) else (
- echo %KEYSTORE_FILE% not found. Create a keystore first by using
- echo usage:%0% -create
- )
- ) else (
- goto prompt
- )
- ) else (
- goto prompt
- )
+ goto prompt
)
-)
goto end
:prompt
- echo usage:%0% -create
- echo usage:%0% -encrypt plain-text-password
+ echo This scripts helps to create a security key, and helps to encrypt a clear text
password
+ echo
+ echo usage: %0% [options]
+ echo options:
+ echo -c, --create Creates security key "teiid.keystore" file in the
"deploy" directory
+ echo -e, --encrypt [password] Encrypts the clear text password into encrypted form
goto end
:end
\ No newline at end of file
Modified: trunk/build/kit-runtime/bin/keystore.sh
===================================================================
--- trunk/build/kit-runtime/bin/keystore.sh 2009-07-27 21:20:17 UTC (rev 1195)
+++ trunk/build/kit-runtime/bin/keystore.sh 2009-07-28 17:58:26 UTC (rev 1196)
@@ -1,4 +1,15 @@
#!/bin/sh
+### ==================================================================================
###
+### This script helps in creating a security key for encrypting
###
+### passwords and also helps in converting a clear text password into a
###
+### encrypted one. For more information on how to use encrypted passwords please
###
+### check out
https://www.jboss.org/community/wiki/EncryptingpasswordsinTeiid
###
+###
###
+### usage: ./keystore.sh [options]
###
+### options:
###
+### -c, --create Creates security key "teiid.keystore" file in the deploy
directory ###
+### -e, --encrypt <password> Encrypts the clear text password into encrypted form
###
+### ==================================================================================
###
DIRNAME=`dirname $0`
@@ -49,8 +60,11 @@
fi
prompt() {
- echo "usage:$0 -create"
- echo "usage:$0 -encrypt <plain-text-password> "
+ echo "echo This scripts helps to create a security key, and helps to encrypt a
clear text password"
+ echo "usage: $0 [options]"
+ echo "options:"
+ echo "-c, --create Creates security key \"teiid.keystore\" file in the
\"deploy\" directory"
+ echo "-e, --encrypt <password> Encrypts the clear text password into
encrypted form"
}
KEYSTORE_FILE=$TEIID_HOME/deploy/teiid.keystore
@@ -59,7 +73,7 @@
then
prompt;
else
- if [ "${1}" = "-create" ]
+ if [ "${1}" = "-c" -o "${1}" = "--create" ]
then
# generate teiid.keystore if does not exist.
if [ ! -f $KEYSTORE_FILE ]; then
@@ -69,12 +83,12 @@
echo "$KEYSTORE_FILE already exists. Delete the current one if you would like to
create a new keystore"
fi
else
- if [ "${1}" = "-encrypt" -a "${2}" != "" ];
then
+ if [ "${1}" = "-e" -o "${1}" = "--encrypt" -a
"${2}" != "" ]; then
if [ -f $KEYSTORE_FILE ]; then
"$JAVA" -classpath $TEIID_CLASSPATH
com.metamatrix.common.util.crypto.CryptoUtil -key $KEYSTORE_FILE -encrypt $2
else
- echo "$KEYSTORE_FILE not found. Create a keystore first by using
"
- echo "$0 -create"
+ echo "$KEYSTORE_FILE not found. Create a security key by using
"
+ echo "$0 --create"
fi
else
prompt
Modified: trunk/build/kit-runtime/bin/run.bat
===================================================================
--- trunk/build/kit-runtime/bin/run.bat 2009-07-27 21:20:17 UTC (rev 1195)
+++ trunk/build/kit-runtime/bin/run.bat 2009-07-28 17:58:26 UTC (rev 1196)
@@ -1,6 +1,8 @@
@echo off
rem -------------------------------------------------------------------------
-rem Teiid Bootstrap Script for Windows (borrowed & modified from JBoss AS)
+rem This script starts the Teiid in stand alone Server mode. Once started
+rem successfully JDBC clients can connect to the server over socket transport.
+rem Check the documentation to use Teiid in embedded mode.
rem -------------------------------------------------------------------------
Modified: trunk/build/kit-runtime/bin/run.sh
===================================================================
--- trunk/build/kit-runtime/bin/run.sh 2009-07-27 21:20:17 UTC (rev 1195)
+++ trunk/build/kit-runtime/bin/run.sh 2009-07-28 17:58:26 UTC (rev 1196)
@@ -1,9 +1,9 @@
#!/bin/sh
-### ====================================================================== ###
-## ##
-## Teiid Bootstrap Script ##
-## (script borrowed from JBossAS) ##
-### ====================================================================== ###
+### ========================================================================== ###
+### This script starts the Teiid in stand alone Server mode. Once started ###
+### successfully JDBC clients can connect to the server over socket transport. ###
+### Check the documentation to use Teiid in embedded mode. ###
+### ========================================================================== ###
DIRNAME=`dirname $0`
Modified: trunk/build/kit-runtime/bin/shutdown.bat
===================================================================
--- trunk/build/kit-runtime/bin/shutdown.bat 2009-07-27 21:20:17 UTC (rev 1195)
+++ trunk/build/kit-runtime/bin/shutdown.bat 2009-07-28 17:58:26 UTC (rev 1196)
@@ -1,6 +1,7 @@
@echo off
rem -------------------------------------------------------------------------
-rem Teiid Bootstrap Script for Windows (borrowed & modified from JBoss AS)
+rem This scripts sends a shuts down signal to the running Teiid Server on
+rem the local machine.
rem -------------------------------------------------------------------------
Modified: trunk/build/kit-runtime/bin/shutdown.sh
===================================================================
--- trunk/build/kit-runtime/bin/shutdown.sh 2009-07-27 21:20:17 UTC (rev 1195)
+++ trunk/build/kit-runtime/bin/shutdown.sh 2009-07-28 17:58:26 UTC (rev 1196)
@@ -1,8 +1,7 @@
#!/bin/sh
### ====================================================================== ###
-## ##
-## Teiid Bootstrap Script ##
-## (script borrowed from JBossAS) ##
+### This scripts sends a shuts down signal to the running Teiid Server on ###
+### the local machine. ###
### ====================================================================== ###
DIRNAME=`dirname $0`