Skip to content

Commit

Permalink
Add docker entrypoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidtw committed Apr 1, 2024
1 parent 9c84351 commit 94dad1d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .release/docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SPDX-FileCopyrightText: 2024 Comcast Cable Communications Management, LLC
# SPDX-License-Identifier: Apache-2.0
#!/usr/bin/env sh
set -e

# check arguments for an option that would cause /xmidt-agent to stop
# return true if there is one
_want_help() {
local arg
for arg; do
case "$arg" in
-'?'|-h|--help|-s|--show)
return 0
;;
esac
done
return 1
}

_main() {
# if command starts with an option, prepend xmidt-agent
if [ "${1:0:1}" = '-' ]; then
set -- /xmidt-agent "$@"
fi

# skip setup if they aren't running /xmidt-agent or want an option that stops /xmidt-agent
if [ "$1" = '/xmidt-agent' ] && ! _want_help "$@"; then
echo "Entrypoint script for xmidt-agent Client ${VERSION} started."
fi

exec "$@"
}

_main "$@"

0 comments on commit 94dad1d

Please sign in to comment.