File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 22
33# update latest available version in /var/run/.ncp-latest-version
44
5- rm -rf /tmp/ncp-check-tmp
5+ TMPDIR=" $( mktemp -d /tmp/ncp-check.XXXXXX || ( echo " Failed to create temp dir. Exiting" >&2 ; exit 1 ) ) "
6+ trap " rm -rf \" ${TMPDIR} \" ; exit 0" 0 1 2 3 15
67
7- git clone --depth 20 -q --bare https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp || {
8+ git clone --depth 20 -q --bare https://github.com/nextcloud/nextcloudpi.git " $TMPDIR " || {
89 echo " The git clone command failed: No connectivity to https://github.com ?"
910 exit 1
1011}
1112
12- cd /tmp/ncp-check-tmp || exit 1
13+ cd " $TMPDIR " || exit 1
1314VER=$( git describe --always --tags | grep -oP " v\d+\.\d+\.\d+" )
1415grep -qP " v\d+\.\d+\.\d+" <<< " $VER" && { # check format
1516 echo " $VER " > /var/run/.ncp-latest-version
@@ -22,5 +23,3 @@ grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format
2223 sed ' s|* \[tag: |[|' > /usr/local/etc/ncp-changelog
2324}
2425cd / || exit 1
25-
26- rm -rf /tmp/ncp-check-tmp
Original file line number Diff line number Diff line change 88 BRANCH=" ${1:- master} "
99 [[ " $BRANCH " != " master" ]] && echo " INFO: updating to development branch '$BRANCH '"
1010
11- echo -e " Downloading updates "
12- rm -rf /tmp/ncp-update-tmp
11+ TMPDIR= " $( mktemp -d /tmp/ncp-update.XXXXXX || ( echo " Failed to create temp dir. Exiting " >&2 ; exit 1 ) ) "
12+ trap " rm -rf \" ${TMPDIR} \" ; exit 0 " 0 1 2 3 15
1313
14- git clone --depth 20 -b " $BRANCH " -q https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || {
14+ echo -e " Downloading updates"
15+ git clone --depth 20 -b " $BRANCH " -q https://github.com/nextcloud/nextcloudpi.git " $TMPDIR " || {
1516 echo " No internet connectivity"
1617 exit 1
1718 }
18- cd /tmp/ncp-update-tmp
19+ cd " $TMPDIR "
1920
2021 echo -e " Performing updates"
2122 ./update.sh && {
3637 }
3738
3839 cd /
39- rm -rf /tmp/ncp-update-tmp
4040
4141 exit
4242} # force to read the whole thing into memory, as its contents might change in update.sh
Original file line number Diff line number Diff line change 11
2- [ v0.54.3] ( https://github.com/nextcloud/nextcloudpi/commit/921b583 ) (2018-05-03) nc-datadir: avoid using occ for faster execution
2+ [ v0.54.4] ( https://github.com/nextcloud/nextcloudpi/commit/36fed66 ) (2018-05-09) avoid temp dir vulnerabilities
3+
4+ [ v0.54.3 ] ( https://github.com/nextcloud/nextcloudpi/commit/66dfbd0 ) (2018-05-03) nc-datadir: avoid using occ for faster execution
35
46[ v0.54.2 ] ( https://github.com/nextcloud/nextcloudpi/commit/ebfb7f1 ) (2018-05-03) samba: restart after configuration change
57
You can’t perform that action at this time.
0 commit comments