mirror of
https://github.com/friendica/docker
synced 2024-06-21 07:54:40 +02:00
Replace su with gosu
This commit is contained in:
parent
34bb363503
commit
c9965262bb
|
@ -3,12 +3,11 @@ set -eu
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
set -- -c "cd /var/www/html; $*"
|
set -- sh -c "cd /var/www/html; $*"
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
|
set -- gosu www-data "$@"
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
fi
|
||||||
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
|
|
|
@ -3,12 +3,11 @@ set -eu
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
set -- -c "cd /var/www/html; $*"
|
set -- sh -c "cd /var/www/html; $*"
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
|
set -- gosu www-data "$@"
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
fi
|
||||||
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
|
|
|
@ -3,12 +3,11 @@ set -eu
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
set -- -c "cd /var/www/html; $*"
|
set -- sh -c "cd /var/www/html; $*"
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
|
set -- gosu www-data "$@"
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
fi
|
||||||
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
|
|
|
@ -3,12 +3,11 @@ set -eu
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
set -- -c "cd /var/www/html; $*"
|
set -- sh -c "cd /var/www/html; $*"
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
|
set -- gosu www-data "$@"
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
fi
|
||||||
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
|
|
|
@ -3,12 +3,11 @@ set -eu
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
set -- -c "cd /var/www/html; $*"
|
set -- sh -c "cd /var/www/html; $*"
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
|
set -- gosu www-data "$@"
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
fi
|
||||||
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
|
|
|
@ -3,12 +3,11 @@ set -eu
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
set -- -c "cd /var/www/html; $*"
|
set -- sh -c "cd /var/www/html; $*"
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
|
set -- gosu www-data "$@"
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
fi
|
||||||
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
|
|
|
@ -3,12 +3,11 @@ set -eu
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
set -- -c "cd /var/www/html; $*"
|
set -- sh -c "cd /var/www/html; $*"
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
|
set -- gosu www-data "$@"
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
fi
|
||||||
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
|
|
|
@ -3,12 +3,11 @@ set -eu
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
set -- -c "cd /var/www/html; $*"
|
set -- sh -c "cd /var/www/html; $*"
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
|
set -- gosu www-data "$@"
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
fi
|
||||||
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
|
|
|
@ -3,12 +3,11 @@ set -eu
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
set -- -c "cd /var/www/html; $*"
|
set -- sh -c "cd /var/www/html; $*"
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
|
set -- gosu www-data "$@"
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
fi
|
||||||
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
|
|
|
@ -3,12 +3,11 @@ set -eu
|
||||||
|
|
||||||
# run an command with the www-data user
|
# run an command with the www-data user
|
||||||
run_as() {
|
run_as() {
|
||||||
set -- -c "cd /var/www/html; $*"
|
set -- sh -c "cd /var/www/html; $*"
|
||||||
if [ "$(id -u)" -eq 0 ]; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
su - www-data -s /bin/sh -c "export PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}; export PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}; $1"
|
set -- gosu www-data "$@"
|
||||||
else
|
|
||||||
sh -c "$1"
|
|
||||||
fi
|
fi
|
||||||
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if the the first parameter is greater than the second parameter
|
# checks if the the first parameter is greater than the second parameter
|
||||||
|
|
Loading…
Reference in a new issue