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
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2017-11-04 20:18:59 +0300
committernachoparker <nacho@ownyourbits.com>2017-11-04 20:19:30 +0300
commitfa2279faa9c5db091b97376a323275ad1f368ef6 (patch)
tree52d84e48c94da0c82b2ef03ea7b74ddc70557572
parent961008cd4654f53036d89dbf89595664cd3ba0fc (diff)
ncp-web: fix return valuev0.32.2
-rw-r--r--nextcloudpi.sh3
-rwxr-xr-xupdate.sh19
2 files changed, 21 insertions, 1 deletions
diff --git a/nextcloudpi.sh b/nextcloudpi.sh
index 7501f55f..c1d3cefd 100644
--- a/nextcloudpi.sh
+++ b/nextcloudpi.sh
@@ -109,10 +109,13 @@ touch /run/ncp.log
chmod 640 /run/ncp.log
chown root:www-data /run/ncp.log
launch_script $1 &> /run/ncp.log
+RET=$?
# clean log for the next PHP backend call to start clean,
# but wait until everything from current execution is read
sleep 0.5 && echo "" > /run/ncp.log
+
+exit $RET
EOF
chmod 700 /home/www/ncp-launcher.sh
echo "www-data ALL = NOPASSWD: /home/www/ncp-launcher.sh , /sbin/halt" >> /etc/sudoers
diff --git a/update.sh b/update.sh
index 9b9fc81b..d189942e 100755
--- a/update.sh
+++ b/update.sh
@@ -197,7 +197,24 @@ EOF
# log adjustment for wizard
test -f /home/www/ncp-launcher.sh && \
- grep -q sleep /home/www/ncp-launcher.sh || echo "sleep 0.5 && echo \"\" > /run/ncp.log" >> /home/www/ncp-launcher.sh
+ cat > /home/www/ncp-launcher.sh <<'EOF'
+#!/bin/bash
+DIR=/usr/local/etc/nextcloudpi-config.d
+test -f $DIR/$1 || { echo "File not found"; exit 1; }
+source /usr/local/etc/library.sh
+cd $DIR
+touch /run/ncp.log
+chmod 640 /run/ncp.log
+chown root:www-data /run/ncp.log
+launch_script $1 &> /run/ncp.log
+RET=$?
+
+# clean log for the next PHP backend call to start clean,
+# but wait until everything from current execution is read
+sleep 0.5 && echo "" > /run/ncp.log
+
+exit $RET
+EOF
# 2 days to avoid very big backups requests to timeout
grep -q TimeOut /etc/apache2/sites-enabled/ncp.conf || \