mongo/evergreen/powercycle_exit.sh
Zack Winter 7ccc14bf91 SERVER-101034 Use rules_lint shfmt formatter (#38448)
GitOrigin-RevId: e8ef1ba2000e12fa2cd5a115a9ceeab92332e938
2025-07-16 01:55:34 +00:00

16 lines
415 B
Bash

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
. "$DIR/prelude.sh"
# Test exits from here with specified exit_code.
if [ -n "${exit_code}" ]; then
# Python program saved exit_code
exit_code=${exit_code}
elif [ -f error_exit.txt ]; then
# Bash trap exit_code
exit_code=$(cat error_exit.txt)
else
exit_code=0
fi
echo "Exiting powercycle with code $exit_code"
exit $exit_code