mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-30 19:09:13 +01:00
17 lines
423 B
Plaintext
17 lines
423 B
Plaintext
|
#!/command/with-contenv bash
|
||
|
# shellcheck shell=bash
|
||
|
# Take down the S6 supervision tree when the service exits
|
||
|
|
||
|
set -o errexit -o nounset -o pipefail
|
||
|
|
||
|
# Prepare exit code
|
||
|
if [[ "${1}" -eq 256 ]]; then
|
||
|
exit_code="$((128 + ${2}))"
|
||
|
else
|
||
|
exit_code="${1}"
|
||
|
fi
|
||
|
|
||
|
# Make the container exit with the same exit code as the service
|
||
|
echo "${exit_code}" > /run/s6-linux-init-container-results/exitcode
|
||
|
exec /run/s6/basedir/bin/halt
|