mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-09 06:32:00 -03:30
nc-autoupdate-nc: Fix erroneous update/updated notifications
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
parent
29e6c05937
commit
aaf7536943
@ -8,7 +8,10 @@ source /usr/local/etc/library.sh # sets NCLATESTVER
|
||||
|
||||
CURRENT="$(nc_version)"
|
||||
NEXT_VERSION="$(determine_nc_update_version "${CURRENT}" "${NCLATESTVER?}")"
|
||||
[[ -n "$NEXT_VERSION" ]] || exit 0
|
||||
if [[ -z "$NEXT_VERSION" ]] || [[ "$NEXT_VERSION" == "${CURRENT}" ]]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
NOTIFIED=/var/run/.nc-version-notified
|
||||
|
||||
|
||||
@ -26,19 +26,19 @@ VER="$1"
|
||||
connect_to_nc_update() {
|
||||
tail -n 100 -f "/var/log/ncp-update-nc.log" &
|
||||
tail_pid=$!
|
||||
trap "kill '$tail_pid'" EXIT
|
||||
while [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|activating|deactivating)$ ]]
|
||||
do
|
||||
sleep 3
|
||||
done
|
||||
|
||||
kill "$tail_pid"
|
||||
if [[ "$(systemctl is-active ncp-update-nc ||:)" == "inactive" ]]
|
||||
then
|
||||
echo "Nextcloud update finished successfully."
|
||||
return 0
|
||||
elif [[ "$(systemctl is-active ncp-update-nc ||:)" == "failed" ]]
|
||||
then
|
||||
echo "Nextcloud update failed."
|
||||
echo "Nextcloud update failed (or was installed already)."
|
||||
return 1
|
||||
else
|
||||
echo "Nextcloud update was not found or failed (unexpected status: '$(systemctl is-active ncp-update-nc ||:)')"
|
||||
@ -52,15 +52,16 @@ then
|
||||
exit $?
|
||||
fi
|
||||
|
||||
systemctl reset-failed ncp-encrypt ||:
|
||||
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"
|
||||
sleep 5
|
||||
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
|
||||
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"
|
||||
sleep 1
|
||||
|
||||
if ! [[ "$(systemctl is-active ncp-update-nc ||:)" =~ ^(active|inactive|activating|deactivating)$ ]]
|
||||
then
|
||||
echo "Failed to start ncp-update-nc"
|
||||
[[ -f /var/log/ncp-update-nc.log ]] && cat /var/log/ncp-update-nc.log
|
||||
systemctl status --no-pager ncp-update-nc ||:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
connect_to_nc_update
|
||||
|
||||
@ -31,7 +31,7 @@ fi
|
||||
TARGET_VERSION="$(determine_nc_update_version "${CURRENT?}" "${NCLATESTVER}" "${REQUESTED_VERSION}")"
|
||||
[[ "$TARGET_VERSION" == "$CURRENT" ]] && {
|
||||
echo "Nextcloud version ${CURRENT} is already installed. Nothing to do."
|
||||
exit 0
|
||||
exit 1
|
||||
}
|
||||
[[ -n "$TARGET_VERSION" ]] || {
|
||||
echo "Could not find a valid upgrade path from '${CURRENT}' to '${TARGET_VERSION}'. Nothing to update."
|
||||
|
||||
@ -58,7 +58,7 @@ configure()
|
||||
export PASSWORD
|
||||
# Just mount already encrypted data
|
||||
if [[ -f "${encdir?}"/gocryptfs.conf ]]; then
|
||||
systemctl reset-failed ncp-encrypt ||:
|
||||
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
|
||||
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"
|
||||
|
||||
# switch to the regular virtual hosts after we decrypt, so we can access NC and ncp-web
|
||||
@ -88,7 +88,7 @@ configure()
|
||||
mv "${datadir?}" "${tmpdir?}"
|
||||
|
||||
mkdir "${datadir}"
|
||||
systemctl reset-failed ncp-encrypt ||:
|
||||
systemctl reset-failed ncp-encrypt 2>/dev/null ||:
|
||||
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"
|
||||
|
||||
maxtries=5
|
||||
|
||||
@ -23,7 +23,7 @@ configure()
|
||||
source /usr/local/etc/library.sh
|
||||
|
||||
echo -e "[ncp-update-nc]" >> /var/log/ncp.log
|
||||
/usr/local/bin/ncp-update-nc "$NCLATESTVER" 2>&1 | tee -a /var/log/ncp.log
|
||||
/usr/local/bin/ncp-update-nc "latest" 2>&1 | tee -a /var/log/ncp.log
|
||||
|
||||
if [[ \${PIPESTATUS[0]} -eq 0 ]]; then
|
||||
|
||||
|
||||
50
staged_rollouts/v1.55.2.txt
Normal file
50
staged_rollouts/v1.55.2.txt
Normal file
@ -0,0 +1,50 @@
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
9
|
||||
10
|
||||
13
|
||||
15
|
||||
26
|
||||
29
|
||||
30
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37
|
||||
38
|
||||
39
|
||||
40
|
||||
41
|
||||
42
|
||||
43
|
||||
44
|
||||
45
|
||||
46
|
||||
47
|
||||
48
|
||||
51
|
||||
54
|
||||
55
|
||||
59
|
||||
60
|
||||
62
|
||||
63
|
||||
64
|
||||
68
|
||||
69
|
||||
70
|
||||
73
|
||||
74
|
||||
75
|
||||
76
|
||||
84
|
||||
89
|
||||
92
|
||||
96
|
||||
6
updates/1.55.2.sh
Normal file
6
updates/1.55.2.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
source /usr/local/etc/library.sh
|
||||
|
||||
run_app nc-autoupdate-nc
|
||||
Loading…
x
Reference in New Issue
Block a user