diff --git a/docker-mods.v3 b/docker-mods.v3 index 36419b9..cf0e9ea 100755 --- a/docker-mods.v3 +++ b/docker-mods.v3 @@ -1,11 +1,11 @@ #!/command/with-contenv bash # shellcheck shell=bash -# Use /command/with-contenv shebang because /usr/bin/with-contenv is created in this script +# Use /command/with-contenv shebang because /usr/bin/with-contenv is created in this script for older bases # Version 3 # 2022-09-25 - Initial Release -MOD_SCRIPT_VER="3.20240928" +MOD_SCRIPT_VER="3.20241018" # Define custom folder paths SCRIPTS_DIR="/custom-cont-init.d" @@ -490,7 +490,9 @@ fi if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then # Run alias creation functions - create_with_contenv_alias + if [[ ! -f "/usr/bin/with-contenv" ]]; then + create_with_contenv_alias + fi if [[ -d "${SCRIPTS_DIR}" ]] || [[ -d "${SERVICES_DIR}" ]]; then tamper_check diff --git a/with-contenv.v1 b/with-contenv.v1 new file mode 100644 index 0000000..2e173ca --- /dev/null +++ b/with-contenv.v1 @@ -0,0 +1,15 @@ +#!/bin/bash + +# Use /bin/bash shebang because we don't want the container environment in here + +# Version 1 +# 2024-10-18 - Initial Release +WITHCONTENV_VER="1.20241018" + +if [[ -f /run/s6/container_environment/UMASK ]] && + { [[ "$(pwdx $$)" =~ "/run/s6/legacy-services/" ]] || + [[ "$(pwdx $$)" =~ "/run/s6/services/" ]] || + [[ "$(pwdx $$)" =~ "/servicedirs/svc-" ]]; }; then + umask "$(cat /run/s6/container_environment/UMASK)" +fi +exec /command/with-contenv "$@"