Files
ubuntu/scripts/entrypoint.sh
Ameer Hamza 7d9ccc97aa
All checks were successful
continuous-integration/drone/push Build is passing
Fixed a missing sudo in the entrypoint.
2023-12-11 11:23:33 +08:00

23 lines
448 B
Bash
Executable File

#!/usr/bin/env bash
set -x
term_handler() {
eval $USER_COMMAND_EXIT
eval $SYS_COMMAND_EXIT
exit 143; # 128 + 15 -- SIGTERM
}
# setup handler when the container is exited
trap 'kill ${!}; term_handler' SIGTERM
# setup home directory for the current user. It is useful for attaching vscode with container.
sudo mkhomedir_helper `whoami`
sudo touch $LOG_FILE
eval $SYS_COMMAND_INIT
eval $USER_COMMAND_INIT &
tail -f $LOG_FILE & wait ${!}