Skip to content

Commit

Permalink
Merge pull request #347 from weaveworks/entrypoint-equals
Browse files Browse the repository at this point in the history
Support --probe.foo=bar style in entrypoint.sh
  • Loading branch information
paulbellamy committed Aug 11, 2015
2 parents 6d4dfb5 + a17d0ba commit 106d166
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,48 @@ while true; do
--dns)
[ $# -gt 1 ] || usage
DNS_SERVER="$2"
shift 2
shift
;;
--searchpath)
[ $# -gt 1 ] || usage
SEARCHPATH="$2"
shift 2
shift
;;
--app.*)
[ $# -gt 1 ] || usage
ARG_NAME=$(echo "$1" | sed 's/\-\-app\.//')
ARG_VALUE="$2"
shift 2
if echo "$1" | grep "="; then
ARG_NAME=$(echo "$1" | sed 's/\-\-app\.\([^=]*\)=\(.*\)/\1/')
ARG_VALUE=$(echo "$1" | sed 's/\-\-app\.\([^=]*\)=\(.*\)/\2/')
else
[ $# -gt 1 ] || usage
ARG_NAME=$(echo "$1" | sed 's/\-\-app\.//')
ARG_VALUE="$2"
shift
fi
APP_ARGS="$APP_ARGS -$ARG_NAME=$ARG_VALUE"
;;
--probe.*)
[ $# -gt 1 ] || usage
ARG_NAME=$(echo "$1" | sed 's/\-\-probe\.//')
ARG_VALUE="$2"
shift 2
if echo "$1" | grep "="; then
ARG_NAME=$(echo "$1" | sed 's/\-\-probe\.\([^=]*\)=\(.*\)/\1/')
ARG_VALUE=$(echo "$1" | sed 's/\-\-probe\.\([^=]*\)=\(.*\)/\2/')
else
[ $# -gt 1 ] || usage
ARG_NAME=$(echo "$1" | sed 's/\-\-probe\.//')
ARG_VALUE="$2"
shift
fi
PROBE_ARGS="$PROBE_ARGS -$ARG_NAME=$ARG_VALUE"
;;
--no-app)
touch /etc/service/app/down
shift 1
;;
--no-probe)
touch /etc/service/probe/down
shift 1
;;
*)
break
;;
esac
shift
done

mkdir -p /etc/weave
Expand Down

0 comments on commit 106d166

Please sign in to comment.