__nextcloud: harden here-doc for su call

Because the here-doc will be evaluated again by the shell, it will was
changed to avoid this. Because the script does not depend on such
function, it will be done in faviour of special characters.
This commit is contained in:
matze 2020-12-25 11:44:32 +01:00
parent b6db7b5ca8
commit 1a233062a5

View file

@ -16,7 +16,7 @@ occ() {
# su creates a new shell, so it does not affect the current session # su creates a new shell, so it does not affect the current session
# will not use -q as it supresses errors, too # will not use -q as it supresses errors, too
cat << SHELL cat << SHELL
su -s /bin/sh -l "$user" -- -e <<SU su -s /bin/sh -l "$user" -- -e <<'SU'
cd '$installdir' && php occ --no-warnings --no-interaction --no-ansi $@ cd '$installdir' && php occ --no-warnings --no-interaction --no-ansi $@
SU SU
SHELL SHELL