From 4d6cb91984aa72934e2474918d8f1eeb6549fbdd Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 4 Oct 2017 18:15:02 +1100 Subject: [PATCH] created JETTY_START variable --- 9.2-jre7/docker-entrypoint.sh | 27 +++++++++++++++---------- 9.2-jre7/generate-jetty-start.sh | 7 +++++-- 9.2-jre8/docker-entrypoint.sh | 27 +++++++++++++++---------- 9.2-jre8/generate-jetty-start.sh | 7 +++++-- 9.3-jre8/alpine/docker-entrypoint.sh | 27 +++++++++++++++---------- 9.3-jre8/alpine/generate-jetty-start.sh | 7 +++++-- 9.3-jre8/docker-entrypoint.sh | 27 +++++++++++++++---------- 9.3-jre8/generate-jetty-start.sh | 7 +++++-- 9.4-jre8/alpine/docker-entrypoint.sh | 27 +++++++++++++++---------- 9.4-jre8/alpine/generate-jetty-start.sh | 7 +++++-- 9.4-jre8/docker-entrypoint.sh | 27 +++++++++++++++---------- 9.4-jre8/generate-jetty-start.sh | 7 +++++-- docker-entrypoint.sh | 27 +++++++++++++++---------- generate-jetty-start.sh | 7 +++++-- 14 files changed, 147 insertions(+), 91 deletions(-) diff --git a/9.2-jre7/docker-entrypoint.sh b/9.2-jre7/docker-entrypoint.sh index 4adaaaa..f6946e6 100755 --- a/9.2-jre7/docker-entrypoint.sh +++ b/9.2-jre7/docker-entrypoint.sh @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then TMPDIR=/tmp/jetty mkdir $TMPDIR 2>/dev/null fi + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi + case "$JAVA_OPTIONS" in *-Djava.io.tmpdir=*) ;; *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then EOWARN fi - if [ -f $JETTY_BASE/jetty.start ] ; then - if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then cat >&2 <<- 'EOWARN' ******************************************************************** WARNING: The $JETTY_BASE/start.d directory has been modified since - the $JETTY_BASE/jetty.start files was generated. Either delete - the $JETTY_BASE/jetty.start file or re-run - /generate-jetty.start.sh + the $JETTY_START files was generated. Either delete + the $JETTY_START file or re-run + /generate-jetty.start.sh from a Dockerfile ******************************************************************** EOWARN fi - echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start - set -- $(cat $JETTY_BASE/jetty.start) + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + set -- $(cat $JETTY_START) else # Do a jetty dry run to set the final command - "$@" --dry-run > $JETTY_BASE/jetty.start - if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then + "$@" --dry-run > $JETTY_START + if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then # command was more than a dry-run - cat $JETTY_BASE/jetty.start \ + cat $JETTY_START \ | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \ | egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration ' exit fi - set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start) + set -- $(sed 's/\\$//' $JETTY_START) fi fi diff --git a/9.2-jre7/generate-jetty-start.sh b/9.2-jre7/generate-jetty-start.sh index 0a7c12d..de78102 100755 --- a/9.2-jre7/generate-jetty-start.sh +++ b/9.2-jre7/generate-jetty-start.sh @@ -1,4 +1,7 @@ #!/bin/sh -rm -f $JETTY_BASE/jetty.start -/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START +/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START diff --git a/9.2-jre8/docker-entrypoint.sh b/9.2-jre8/docker-entrypoint.sh index 4adaaaa..f6946e6 100755 --- a/9.2-jre8/docker-entrypoint.sh +++ b/9.2-jre8/docker-entrypoint.sh @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then TMPDIR=/tmp/jetty mkdir $TMPDIR 2>/dev/null fi + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi + case "$JAVA_OPTIONS" in *-Djava.io.tmpdir=*) ;; *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then EOWARN fi - if [ -f $JETTY_BASE/jetty.start ] ; then - if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then cat >&2 <<- 'EOWARN' ******************************************************************** WARNING: The $JETTY_BASE/start.d directory has been modified since - the $JETTY_BASE/jetty.start files was generated. Either delete - the $JETTY_BASE/jetty.start file or re-run - /generate-jetty.start.sh + the $JETTY_START files was generated. Either delete + the $JETTY_START file or re-run + /generate-jetty.start.sh from a Dockerfile ******************************************************************** EOWARN fi - echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start - set -- $(cat $JETTY_BASE/jetty.start) + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + set -- $(cat $JETTY_START) else # Do a jetty dry run to set the final command - "$@" --dry-run > $JETTY_BASE/jetty.start - if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then + "$@" --dry-run > $JETTY_START + if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then # command was more than a dry-run - cat $JETTY_BASE/jetty.start \ + cat $JETTY_START \ | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \ | egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration ' exit fi - set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start) + set -- $(sed 's/\\$//' $JETTY_START) fi fi diff --git a/9.2-jre8/generate-jetty-start.sh b/9.2-jre8/generate-jetty-start.sh index 0a7c12d..de78102 100755 --- a/9.2-jre8/generate-jetty-start.sh +++ b/9.2-jre8/generate-jetty-start.sh @@ -1,4 +1,7 @@ #!/bin/sh -rm -f $JETTY_BASE/jetty.start -/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START +/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START diff --git a/9.3-jre8/alpine/docker-entrypoint.sh b/9.3-jre8/alpine/docker-entrypoint.sh index 4adaaaa..f6946e6 100755 --- a/9.3-jre8/alpine/docker-entrypoint.sh +++ b/9.3-jre8/alpine/docker-entrypoint.sh @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then TMPDIR=/tmp/jetty mkdir $TMPDIR 2>/dev/null fi + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi + case "$JAVA_OPTIONS" in *-Djava.io.tmpdir=*) ;; *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then EOWARN fi - if [ -f $JETTY_BASE/jetty.start ] ; then - if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then cat >&2 <<- 'EOWARN' ******************************************************************** WARNING: The $JETTY_BASE/start.d directory has been modified since - the $JETTY_BASE/jetty.start files was generated. Either delete - the $JETTY_BASE/jetty.start file or re-run - /generate-jetty.start.sh + the $JETTY_START files was generated. Either delete + the $JETTY_START file or re-run + /generate-jetty.start.sh from a Dockerfile ******************************************************************** EOWARN fi - echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start - set -- $(cat $JETTY_BASE/jetty.start) + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + set -- $(cat $JETTY_START) else # Do a jetty dry run to set the final command - "$@" --dry-run > $JETTY_BASE/jetty.start - if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then + "$@" --dry-run > $JETTY_START + if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then # command was more than a dry-run - cat $JETTY_BASE/jetty.start \ + cat $JETTY_START \ | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \ | egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration ' exit fi - set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start) + set -- $(sed 's/\\$//' $JETTY_START) fi fi diff --git a/9.3-jre8/alpine/generate-jetty-start.sh b/9.3-jre8/alpine/generate-jetty-start.sh index 0a7c12d..de78102 100755 --- a/9.3-jre8/alpine/generate-jetty-start.sh +++ b/9.3-jre8/alpine/generate-jetty-start.sh @@ -1,4 +1,7 @@ #!/bin/sh -rm -f $JETTY_BASE/jetty.start -/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START +/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START diff --git a/9.3-jre8/docker-entrypoint.sh b/9.3-jre8/docker-entrypoint.sh index 4adaaaa..f6946e6 100755 --- a/9.3-jre8/docker-entrypoint.sh +++ b/9.3-jre8/docker-entrypoint.sh @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then TMPDIR=/tmp/jetty mkdir $TMPDIR 2>/dev/null fi + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi + case "$JAVA_OPTIONS" in *-Djava.io.tmpdir=*) ;; *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then EOWARN fi - if [ -f $JETTY_BASE/jetty.start ] ; then - if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then cat >&2 <<- 'EOWARN' ******************************************************************** WARNING: The $JETTY_BASE/start.d directory has been modified since - the $JETTY_BASE/jetty.start files was generated. Either delete - the $JETTY_BASE/jetty.start file or re-run - /generate-jetty.start.sh + the $JETTY_START files was generated. Either delete + the $JETTY_START file or re-run + /generate-jetty.start.sh from a Dockerfile ******************************************************************** EOWARN fi - echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start - set -- $(cat $JETTY_BASE/jetty.start) + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + set -- $(cat $JETTY_START) else # Do a jetty dry run to set the final command - "$@" --dry-run > $JETTY_BASE/jetty.start - if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then + "$@" --dry-run > $JETTY_START + if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then # command was more than a dry-run - cat $JETTY_BASE/jetty.start \ + cat $JETTY_START \ | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \ | egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration ' exit fi - set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start) + set -- $(sed 's/\\$//' $JETTY_START) fi fi diff --git a/9.3-jre8/generate-jetty-start.sh b/9.3-jre8/generate-jetty-start.sh index 0a7c12d..de78102 100755 --- a/9.3-jre8/generate-jetty-start.sh +++ b/9.3-jre8/generate-jetty-start.sh @@ -1,4 +1,7 @@ #!/bin/sh -rm -f $JETTY_BASE/jetty.start -/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START +/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START diff --git a/9.4-jre8/alpine/docker-entrypoint.sh b/9.4-jre8/alpine/docker-entrypoint.sh index 4adaaaa..f6946e6 100755 --- a/9.4-jre8/alpine/docker-entrypoint.sh +++ b/9.4-jre8/alpine/docker-entrypoint.sh @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then TMPDIR=/tmp/jetty mkdir $TMPDIR 2>/dev/null fi + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi + case "$JAVA_OPTIONS" in *-Djava.io.tmpdir=*) ;; *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then EOWARN fi - if [ -f $JETTY_BASE/jetty.start ] ; then - if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then cat >&2 <<- 'EOWARN' ******************************************************************** WARNING: The $JETTY_BASE/start.d directory has been modified since - the $JETTY_BASE/jetty.start files was generated. Either delete - the $JETTY_BASE/jetty.start file or re-run - /generate-jetty.start.sh + the $JETTY_START files was generated. Either delete + the $JETTY_START file or re-run + /generate-jetty.start.sh from a Dockerfile ******************************************************************** EOWARN fi - echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start - set -- $(cat $JETTY_BASE/jetty.start) + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + set -- $(cat $JETTY_START) else # Do a jetty dry run to set the final command - "$@" --dry-run > $JETTY_BASE/jetty.start - if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then + "$@" --dry-run > $JETTY_START + if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then # command was more than a dry-run - cat $JETTY_BASE/jetty.start \ + cat $JETTY_START \ | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \ | egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration ' exit fi - set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start) + set -- $(sed 's/\\$//' $JETTY_START) fi fi diff --git a/9.4-jre8/alpine/generate-jetty-start.sh b/9.4-jre8/alpine/generate-jetty-start.sh index 0a7c12d..de78102 100755 --- a/9.4-jre8/alpine/generate-jetty-start.sh +++ b/9.4-jre8/alpine/generate-jetty-start.sh @@ -1,4 +1,7 @@ #!/bin/sh -rm -f $JETTY_BASE/jetty.start -/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START +/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START diff --git a/9.4-jre8/docker-entrypoint.sh b/9.4-jre8/docker-entrypoint.sh index 4adaaaa..f6946e6 100755 --- a/9.4-jre8/docker-entrypoint.sh +++ b/9.4-jre8/docker-entrypoint.sh @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then TMPDIR=/tmp/jetty mkdir $TMPDIR 2>/dev/null fi + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi + case "$JAVA_OPTIONS" in *-Djava.io.tmpdir=*) ;; *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then EOWARN fi - if [ -f $JETTY_BASE/jetty.start ] ; then - if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then cat >&2 <<- 'EOWARN' ******************************************************************** WARNING: The $JETTY_BASE/start.d directory has been modified since - the $JETTY_BASE/jetty.start files was generated. Either delete - the $JETTY_BASE/jetty.start file or re-run - /generate-jetty.start.sh + the $JETTY_START files was generated. Either delete + the $JETTY_START file or re-run + /generate-jetty.start.sh from a Dockerfile ******************************************************************** EOWARN fi - echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start - set -- $(cat $JETTY_BASE/jetty.start) + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + set -- $(cat $JETTY_START) else # Do a jetty dry run to set the final command - "$@" --dry-run > $JETTY_BASE/jetty.start - if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then + "$@" --dry-run > $JETTY_START + if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then # command was more than a dry-run - cat $JETTY_BASE/jetty.start \ + cat $JETTY_START \ | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \ | egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration ' exit fi - set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start) + set -- $(sed 's/\\$//' $JETTY_START) fi fi diff --git a/9.4-jre8/generate-jetty-start.sh b/9.4-jre8/generate-jetty-start.sh index 0a7c12d..de78102 100755 --- a/9.4-jre8/generate-jetty-start.sh +++ b/9.4-jre8/generate-jetty-start.sh @@ -1,4 +1,7 @@ #!/bin/sh -rm -f $JETTY_BASE/jetty.start -/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START +/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 4adaaaa..f6946e6 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then TMPDIR=/tmp/jetty mkdir $TMPDIR 2>/dev/null fi + +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi + case "$JAVA_OPTIONS" in *-Djava.io.tmpdir=*) ;; *) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;; @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then EOWARN fi - if [ -f $JETTY_BASE/jetty.start ] ; then - if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then + if [ -f $JETTY_START ] ; then + if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then cat >&2 <<- 'EOWARN' ******************************************************************** WARNING: The $JETTY_BASE/start.d directory has been modified since - the $JETTY_BASE/jetty.start files was generated. Either delete - the $JETTY_BASE/jetty.start file or re-run - /generate-jetty.start.sh + the $JETTY_START files was generated. Either delete + the $JETTY_START file or re-run + /generate-jetty.start.sh from a Dockerfile ******************************************************************** EOWARN fi - echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start - set -- $(cat $JETTY_BASE/jetty.start) + echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START + set -- $(cat $JETTY_START) else # Do a jetty dry run to set the final command - "$@" --dry-run > $JETTY_BASE/jetty.start - if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then + "$@" --dry-run > $JETTY_START + if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then # command was more than a dry-run - cat $JETTY_BASE/jetty.start \ + cat $JETTY_START \ | awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \ | egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration ' exit fi - set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start) + set -- $(sed 's/\\$//' $JETTY_START) fi fi diff --git a/generate-jetty-start.sh b/generate-jetty-start.sh index 0a7c12d..de78102 100755 --- a/generate-jetty-start.sh +++ b/generate-jetty-start.sh @@ -1,4 +1,7 @@ #!/bin/sh -rm -f $JETTY_BASE/jetty.start -/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start +if [ -z "$JETTY_START" ] ; then + JETTY_START=$JETTY_BASE/jetty.start +fi +rm -f $JETTY_START +/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START