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:
parent
6bd977cb3b
commit
42746dc18c
2 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue