mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-09 14:42:01 -03:30
ncp-update-nc: fix update termination detection
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
parent
eea3d51385
commit
1fb070df55
@ -23,19 +23,42 @@ BIN="${0##*/}"
|
||||
VER="$1"
|
||||
[[ "$VER" == "" ]] && { echo "Usage ${BIN} <version>"; exit 1; }
|
||||
|
||||
if systemctl is-active ncp-update-nc >/dev/null 2>&1
|
||||
connect_to_nc_update() {
|
||||
tail -f "/var/log/ncp-update-nc.log" &
|
||||
tail_pid=$!
|
||||
while [[ "$(systemctl is-active ncp-update-nc ||:)" == "active" ]]
|
||||
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."
|
||||
return 1
|
||||
else
|
||||
echo "Nextcloud update was not found or failed (unexpected status: '$(systemctl is-active ncp-update-nc ||:)')"
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ "$(systemctl is-active ncp-update-nc ||:)" == "activating" ]]
|
||||
then
|
||||
echo "Existing ncp-update-nc process detected. Connecting..."
|
||||
tail -f "/var/log/ncp-update-nc.log"
|
||||
connect_to_nc_update
|
||||
exit 0
|
||||
fi
|
||||
|
||||
systemd-run -u 'ncp-update-nc' -p "RemainAfterExit=yes" bash -c "DBG='${DBG:-}' /usr/local/bin/ncp-update-nc.d/update-nc.sh '${VER}' |& tee /var/log/ncp-update-nc.log"
|
||||
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
|
||||
|
||||
if ! systemctl is-active ncp-update-nc >/dev/null 2>&1
|
||||
if [[ "$(systemctl is-active ncp-update-nc ||:)" != "activating" ]]
|
||||
then
|
||||
echo "Failed to start ncp-update-nc"
|
||||
systemctl status --no-pager ncp-update-nc
|
||||
fi
|
||||
tail -f "/var/log/ncp-update-nc.log"
|
||||
|
||||
connect_to_nc_update
|
||||
|
||||
1
build/armbian/armbian_version
Normal file
1
build/armbian/armbian_version
Normal file
@ -0,0 +1 @@
|
||||
v24.08
|
||||
@ -31,7 +31,7 @@ prepare_dirs # tmp cache output
|
||||
|
||||
# get latest armbian
|
||||
[[ -d armbian ]] || {
|
||||
git clone --depth 1 --branch v24.08 https://github.com/armbian/build armbian
|
||||
git clone --depth 1 --branch "$(cat "${0}/../armbian/armbian_version")" https://github.com/armbian/build armbian
|
||||
}
|
||||
#( cd armbian && git pull --ff-only --tags && git checkout v23.02 )
|
||||
#sed -i -e '/export rootfs_size=/s/du -sm/du --apparent-size -sm/' armbian/lib/functions/image/partitioning.sh
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user