mirror of
https://github.com/linuxserver/docker-mods.git
synced 2026-03-23 00:05:28 +08:00
Merge pull request #969 from linuxserver/mod-scripts-contenv
This commit is contained in:
commit
0198da8db7
@ -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
|
||||
|
||||
15
with-contenv.v1
Normal file
15
with-contenv.v1
Normal file
@ -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 "$@"
|
||||
Loading…
x
Reference in New Issue
Block a user