-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·33 lines (27 loc) · 1022 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·33 lines (27 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
## Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
set -o errexit
set -o pipefail
# set -o xtrace # Uncomment this line for debugging purposes.
declare -r ENTRYPOINT_SCRIPTS_DIR="/opt/mediaserver/entrypoint.d"
# Run user-supplied initialization scripts.
if [[ -d "${ENTRYPOINT_SCRIPTS_DIR}" ]]; then
echo "Loading user's custom *.sh,*.py scripts from ${ENTRYPOINT_SCRIPTS_DIR}"
find "${ENTRYPOINT_SCRIPTS_DIR}" -type f -executable -regex ".*\.\(sh\|py\)" | sort | \
{
while read script; do
if ! "${script}"; then
echo "Failed to execute ${script}" >&2
return 1
fi
done
}
fi
# No arguments provided, run the VMS Server.
if [[ $# -lt 1 ]]; then
echo "Launching mediaserver"
exec "/opt/${COMPANY}/mediaserver/bin/mediaserver" -e
fi
# Argument(s) supplied, assume the user wants to run a different process, for example a `bash`
# shell to explore the image.
exec "$@"