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 2
2
3
3
# update latest available version in /var/run/.ncp-latest-version
4
4
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
6
7
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 " || {
8
9
echo " The git clone command failed: No connectivity to https://github.com ?"
9
10
exit 1
10
11
}
11
12
12
- cd /tmp/ncp-check-tmp || exit 1
13
+ cd " $TMPDIR " || exit 1
13
14
VER=$( git describe --always --tags | grep -oP " v\d+\.\d+\.\d+" )
14
15
grep -qP " v\d+\.\d+\.\d+" <<< " $VER" && { # check format
15
16
echo " $VER " > /var/run/.ncp-latest-version
@@ -22,5 +23,3 @@ grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format
22
23
sed ' s|* \[tag: |[|' > /usr/local/etc/ncp-changelog
23
24
}
24
25
cd / || exit 1
25
-
26
- rm -rf /tmp/ncp-check-tmp
Original file line number Diff line number Diff line change 8
8
BRANCH=" ${1:- master} "
9
9
[[ " $BRANCH " != " master" ]] && echo " INFO: updating to development branch '$BRANCH '"
10
10
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
13
13
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 " || {
15
16
echo " No internet connectivity"
16
17
exit 1
17
18
}
18
- cd /tmp/ncp-update-tmp
19
+ cd " $TMPDIR "
19
20
20
21
echo -e " Performing updates"
21
22
./update.sh && {
36
37
}
37
38
38
39
cd /
39
- rm -rf /tmp/ncp-update-tmp
40
40
41
41
exit
42
42
} # 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 1
1
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
3
5
4
6
[ v0.54.2 ] ( https://github.com/nextcloud/nextcloudpi/commit/ebfb7f1 ) (2018-05-03) samba: restart after configuration change
5
7
You can’t perform that action at this time.
0 commit comments