File tree 8 files changed +76
-10
lines changed
8 files changed +76
-10
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ source /usr/local/etc/library.sh # sets NCLATESTVER
8
8
9
9
CURRENT=" $( nc_version) "
10
10
NEXT_VERSION=" $( determine_nc_update_version " ${CURRENT} " " ${NCLATESTVER?} " ) "
11
- [[ -n " $NEXT_VERSION " ]] || exit 0
11
+ if [[ -z " $NEXT_VERSION " ]] || [[ " $NEXT_VERSION " == " ${CURRENT} " ]]
12
+ then
13
+ exit 0
14
+ fi
12
15
13
16
NOTIFIED=/var/run/.nc-version-notified
14
17
Original file line number Diff line number Diff line change @@ -26,19 +26,19 @@ VER="$1"
26
26
connect_to_nc_update () {
27
27
tail -n 100 -f " /var/log/ncp-update-nc.log" &
28
28
tail_pid=$!
29
+ trap " kill '$tail_pid '" EXIT
29
30
while [[ " $( systemctl is-active ncp-update-nc || :) " =~ ^(active| activating| deactivating)$ ]]
30
31
do
31
32
sleep 3
32
33
done
33
34
34
- kill " $tail_pid "
35
35
if [[ " $( systemctl is-active ncp-update-nc || :) " == " inactive" ]]
36
36
then
37
37
echo " Nextcloud update finished successfully."
38
38
return 0
39
39
elif [[ " $( systemctl is-active ncp-update-nc || :) " == " failed" ]]
40
40
then
41
- echo " Nextcloud update failed."
41
+ echo " Nextcloud update failed (or was installed already) ."
42
42
return 1
43
43
else
44
44
echo " Nextcloud update was not found or failed (unexpected status: '$( systemctl is-active ncp-update-nc || :) ')"
52
52
exit $?
53
53
fi
54
54
55
- systemctl reset-failed ncp-encrypt || :
56
- systemd-run -u ' ncp-update-nc' bash -c " DBG='${DBG:- } ' /usr/local/bin/ncp-update-nc.d/update-nc.sh '${VER} ' |& tee /var/log/ncp-update-nc.log"
57
- sleep 5
55
+ systemctl reset-failed ncp-encrypt 2> /dev/null || :
56
+ systemd-run -u ' ncp-update-nc' bash -c " set -o pipefail; DBG='${DBG:- } ' /usr/local/bin/ncp-update-nc.d/update-nc.sh '${VER} ' |& tee /var/log/ncp-update-nc.log"
57
+ sleep 1
58
58
59
59
if ! [[ " $( systemctl is-active ncp-update-nc || :) " =~ ^(active| inactive| activating| deactivating)$ ]]
60
60
then
61
61
echo " Failed to start ncp-update-nc"
62
62
[[ -f /var/log/ncp-update-nc.log ]] && cat /var/log/ncp-update-nc.log
63
63
systemctl status --no-pager ncp-update-nc || :
64
+ exit 1
64
65
fi
65
66
66
67
connect_to_nc_update
Original file line number Diff line number Diff line change 31
31
TARGET_VERSION=" $( determine_nc_update_version " ${CURRENT?} " " ${NCLATESTVER} " " ${REQUESTED_VERSION} " ) "
32
32
[[ " $TARGET_VERSION " == " $CURRENT " ]] && {
33
33
echo " Nextcloud version ${CURRENT} is already installed. Nothing to do."
34
- exit 0
34
+ exit 1
35
35
}
36
36
[[ -n " $TARGET_VERSION " ]] || {
37
37
echo " Could not find a valid upgrade path from '${CURRENT} ' to '${TARGET_VERSION} '. Nothing to update."
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ configure()
58
58
export PASSWORD
59
59
# Just mount already encrypted data
60
60
if [[ -f " ${encdir?} " /gocryptfs.conf ]]; then
61
- systemctl reset-failed ncp-encrypt || :
61
+ systemctl reset-failed ncp-encrypt 2> /dev/null || :
62
62
systemd-run -u ncp-encrypt -E PASSWORD bash -c " gocryptfs -fg -allow_other -q '${encdir} ' '${datadir} ' <<<\"\$ {PASSWORD}\" 2>&1 | sed /^Switch/d |& tee /var/log/ncp-encrypt.log"
63
63
64
64
# switch to the regular virtual hosts after we decrypt, so we can access NC and ncp-web
@@ -88,7 +88,7 @@ configure()
88
88
mv " ${datadir?} " " ${tmpdir?} "
89
89
90
90
mkdir " ${datadir} "
91
- systemctl reset-failed ncp-encrypt || :
91
+ systemctl reset-failed ncp-encrypt 2> /dev/null || :
92
92
systemd-run -u ncp-encrypt -E PASSWORD bash -c " gocryptfs -fg -allow_other -q '${encdir} ' '${datadir} ' <<<\"\$ {PASSWORD}\" 2>&1 | sed /^Switch/d |& tee /var/log/ncp-encrypt.log"
93
93
94
94
maxtries=5
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ configure()
23
23
source /usr/local/etc/library.sh
24
24
25
25
echo -e "[ncp-update-nc]" >> /var/log/ncp.log
26
- /usr/local/bin/ncp-update-nc "$NCLATESTVER " 2>&1 | tee -a /var/log/ncp.log
26
+ /usr/local/bin/ncp-update-nc "latest " 2>&1 | tee -a /var/log/ncp.log
27
27
28
28
if [[ \$ {PIPESTATUS[0]} -eq 0 ]]; then
29
29
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ innodb_file_per_table=1
19
19
innodb_file_format=barracuda
20
20
max_allowed_packet=256M
21
21
22
+ [mysqldump]
23
+ max_allowed_packet = 256M
24
+
22
25
[server]
23
26
# innodb settings
24
27
skip-name-resolve
Original file line number Diff line number Diff line change
1
+ 0
2
+ 1
3
+ 2
4
+ 3
5
+ 4
6
+ 5
7
+ 6
8
+ 9
9
+ 10
10
+ 13
11
+ 15
12
+ 26
13
+ 29
14
+ 30
15
+ 32
16
+ 33
17
+ 34
18
+ 35
19
+ 36
20
+ 37
21
+ 38
22
+ 39
23
+ 40
24
+ 41
25
+ 42
26
+ 43
27
+ 44
28
+ 45
29
+ 46
30
+ 47
31
+ 48
32
+ 51
33
+ 54
34
+ 55
35
+ 59
36
+ 60
37
+ 62
38
+ 63
39
+ 64
40
+ 68
41
+ 69
42
+ 70
43
+ 73
44
+ 74
45
+ 75
46
+ 76
47
+ 84
48
+ 89
49
+ 92
50
+ 96
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ source /usr/local/etc/library.sh
5
+
6
+ run_app nc-autoupdate-nc
7
+
8
+ install_template " mysql/91-ncp.cnf.sh" " /etc/mysql/mariadb.conf.d/91-ncp.cnf"
9
+ service mariadb reload
You can’t perform that action at this time.
0 commit comments