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:
Diffstat (limited to 'bin/ncp-update')
-rwxr-xr-xbin/ncp-update10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/ncp-update b/bin/ncp-update
index 0df91fa9..9e753e80 100755
--- a/bin/ncp-update
+++ b/bin/ncp-update
@@ -8,14 +8,15 @@
BRANCH="${1:-master}"
[[ "$BRANCH" != "master" ]] && echo "INFO: updating to development branch '$BRANCH'"
- echo -e "Downloading updates"
- rm -rf /tmp/ncp-update-tmp
+ TMPDIR="$( mktemp -d /tmp/ncp-update.XXXXXX || ( echo "Failed to create temp dir. Exiting" >&2; exit 1 ) )"
+ trap "rm -rf \"${TMPDIR}\"; exit 0" 0 1 2 3 15
- git clone --depth 20 -b "$BRANCH" -q https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || {
+ echo -e "Downloading updates"
+ git clone --depth 20 -b "$BRANCH" -q https://github.com/nextcloud/nextcloudpi.git "$TMPDIR" || {
echo "No internet connectivity"
exit 1
}
- cd /tmp/ncp-update-tmp
+ cd "$TMPDIR"
echo -e "Performing updates"
./update.sh && {
@@ -36,7 +37,6 @@
}
cd /
- rm -rf /tmp/ncp-update-tmp
exit
} # force to read the whole thing into memory, as its contents might change in update.sh