Move contenv alias to build time for future bases

This commit is contained in:
thespad
2024-10-19 16:05:05 +01:00
parent c259a4d0e0
commit 38d90e8c19
2 changed files with 20 additions and 3 deletions
+15
View 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 "$@"