Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ncp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ncp.sh')
-rw-r--r--ncp.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/ncp.sh b/ncp.sh
index 0b3dd5a4..469bcb81 100644
--- a/ncp.sh
+++ b/ncp.sh
@@ -34,7 +34,8 @@ install()
# add the ncc shortcut
cat > /usr/local/bin/ncc <<'EOF'
#!/bin/bash
-sudo -E -u www-data php /var/www/nextcloud/occ "$@"
+[[ ${EUID} -eq 0 ]] && SUDO="sudo -E -u www-data"
+${SUDO} php /var/www/nextcloud/occ "$@"
EOF
chmod +x /usr/local/bin/ncc