From 15d2db16bded8aa2b8cc4efd33271feaa81adf8b Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Tue, 16 Oct 2018 09:25:45 -0600 Subject: [PATCH] Changed ncMaint to use sudo instead of su to allow non-interactive accts --- root/NCscripts/backup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/root/NCscripts/backup.sh b/root/NCscripts/backup.sh index 354db09..4535b93 100755 --- a/root/NCscripts/backup.sh +++ b/root/NCscripts/backup.sh @@ -142,10 +142,10 @@ function checkExist { ### ncMaint - pass requested mode change type to NextCloud occ function ncMaint { - su -c "php ${ncRoot}/occ maintenance:mode --$1" - "${webUser}" \ - >> "$logFile" 2>&1 - maintResult="$?" - return "$maintResult" + sudo -u ${webUser} php ${ncroot}/occ maintenance:mode --$1 \ + >> "$logFile" 2>&1 + maintResult="$?" + return "$maintResult" } ### cleanup - cleanup files and directories created by this script