23 lines
457 B
Bash
23 lines
457 B
Bash
#!/bin/bash
|
|
|
|
# Allows to attach to a shell inside the container, or run ansbile commands,
|
|
# otherwise run the 'hpa' script with the given arguments.
|
|
#
|
|
while [[ $# -gt 0 ]]; do
|
|
if [[ $1 == "/bin/bash" ]] || [[ $1 == "bash" ]]; then
|
|
shift
|
|
/bin/bash "$@"
|
|
exit $?
|
|
elif [[ $1 == "/bin/sh" ]] || [[ $1 == "sh" ]]; then
|
|
shift
|
|
/bin/sh "$@"
|
|
exit $?
|
|
elif [[ $1 =~ ^ansible ]]; then
|
|
exec "$@"
|
|
exit $?
|
|
else
|
|
/usr/local/bin/hpa "$@"
|
|
fi
|
|
shift
|
|
done
|