Skip to content

Instantly share code, notes, and snippets.

@beatak
Created April 23, 2019 19:46
Show Gist options
  • Save beatak/60f42ac581197d0096e1ab85a02788a8 to your computer and use it in GitHub Desktop.
Save beatak/60f42ac581197d0096e1ab85a02788a8 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
if [ -z "$SERVER_URL" ]; then
echo >&2 'SERVER_URL not set'
exit 1
fi
if [ -z "$LOCATION" ]; then
echo >&2 'LOCATION not set'
exit 1
fi
if [ -z "$EXTRA_ARGS" ]; then
EXTRA_ARGS=""
fi
if [ -n "$NAME" ]; then
EXTRA_ARGS="$EXTRA_ARGS --name $NAME"
fi
if [ -n "$KEY" ]; then
EXTRA_ARGS="$EXTRA_ARGS --key $KEY"
fi
if [ -n "$SHAPER" ]; then
EXTRA_ARGS="$EXTRA_ARGS --shaper $SHAPER"
fi
# exec replaces the shell process by the python process and is required to
# propagate signals (i.e. SIGTERM)
exec python /wptagent/wptagent.py --server "${SERVER_URL}" --location "${LOCATION}" ${EXTRA_ARGS} --xvfb --dockerized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment