Commit 675771bc authored by Misagh Moayyed's avatar Misagh Moayyed

updated

parent 2f88e971
......@@ -96,5 +96,5 @@ Deploy resultant `target/cas.war` to a servlet container of choice.
Invokes the CAS Command Line Shell. For a list of commands either use no arguments or use `-h`. To enter the interactive shell use `-sh`.
```bash
./build.sh command
./build.sh cli
```
\ No newline at end of file
......@@ -64,14 +64,31 @@ function gencert() {
keytool -exportcert -alias cas -storepass changeit -keystore /etc/cas/thekeystore -file /etc/cas/cas.cer
}
function command() {
function cli() {
CAS_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${cas.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec 2>/dev/null)
COMMAND_FILE="./target/cas-server-support-shell-${CAS_VERSION}.jar"
# echo "CAS version: $CAS_VERSION"
JAR_FILE_NAME="cas-server-support-shell-${CAS_VERSION}.jar"
# echo "JAR name: $JAR_FILE_NAME"
JAR_PATH="org/apereo/cas/cas-server-support-shell/${CAS_VERSION}/${JAR_FILE_NAME}"
# echo "JAR path: $JAR_PATH"
JAR_FILE_LOCAL="$HOME/.m2/repository/$JAR_PATH";
# echo "Local JAR file path: $JAR_FILE_LOCAL";
if [ -f "$JAR_FILE_LOCAL" ]; then
# echo "Using JAR file locally at $JAR_FILE_LOCAL"
java -jar $JAR_FILE_LOCAL "$@"
exit 0;
fi
COMMAND_FILE="./target/${JAR_FILE_NAME}"
if [ ! -f "$COMMAND_FILE" ]; then
package
wget -q http://repo1.maven.org/maven2/org/apereo/cas/cas-server-support-shell/${CAS_VERSION}/cas-server-support-shell-${CAS_VERSION}.jar -P ./target
mkdir -p ./target
wget "https://repo1.maven.org/maven2/${JAR_PATH}" -P ./target
java -jar $COMMAND_FILE "$@"
exit 0;
fi
java -jar target/cas-server-support-shell-${CAS_VERSION}.jar "$@"
}
if [ $# -eq 0 ]; then
......@@ -109,12 +126,11 @@ case "$1" in
"gencert")
gencert "$@"
;;
"command")
"cli")
shift
command "$@"
cli "$@"
;;
*)
help
;;
esac
esac
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment