File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ set -eu
1818RUN_AS=" $( stat -c %U /var/www/html/occ) "
1919[ -n " $RUN_AS " ] && [ " $RUN_AS " != " UNKNOWN" ] || { echo " Unable to run \` occ\` : Failed to determine www-data user" >&2 ; exit 1 ; }
2020
21- if [ " $( id -u) " = 0 ]; then
21+ if [ " $( id -u) " = 0 ] && [ " $( id -un ) " != " $RUN_AS " ] ; then
2222 exec su -p " $RUN_AS " -s /bin/sh -c ' exec php -d memory_limit=2G -f /var/www/html/occ -- "$@"' -- ' /bin/sh' " $@ "
2323else
2424 exec php -d memory_limit=2G -f /var/www/html/occ -- " $@ "
Original file line number Diff line number Diff line change 2323RUN_AS=" $( stat -c %U /var/www/html/cron.php) "
2424[ -n " $RUN_AS " ] && [ " $RUN_AS " != " UNKNOWN" ] || { echo " Unable to run \` occ-cron\` : Failed to determine www-data user" >&2 ; exit 1 ; }
2525
26- if [ " $( id -u) " = 0 ]; then
26+ if [ " $( id -u) " = 0 ] && [ " $( id -un ) " != " $RUN_AS " ] ; then
2727 exec su -p " $RUN_AS " -s /bin/sh -c ' exec php -d memory_limit=2G -f /var/www/html/cron.php' -- ' /bin/sh'
2828else
2929 exec php -d memory_limit=2G -f /var/www/html/cron.php
You can’t perform that action at this time.
0 commit comments