0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-03-14 02:25:08 +01:00

Add -p flag for preserve environment and override HOME.

This commit is contained in:
William Pain 2017-11-07 18:20:27 +01:00
parent 6bd977cb3b
commit 42746dc18c
2 changed files with 6 additions and 2 deletions

View file

@ -13,7 +13,9 @@ function directory_empty() {
function run_as() {
if [[ $EUID -eq 0 ]]; then
su - www-data -s /bin/bash -c "$1"
HOME="/var/www"
su - www-data -p -s /bin/bash -c "$1"
HOME="/root"
else
bash -c "$1"
fi

View file

@ -13,7 +13,9 @@ function directory_empty() {
function run_as() {
if [[ $EUID -eq 0 ]]; then
su - www-data -s /bin/bash -c "$1"
HOME="/var/www"
su - www-data -p -s /bin/bash -c "$1"
HOME="/root"
else
bash -c "$1"
fi