Skip to content

Commit

Permalink
ncp-update-nc: fix update termination detection
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Knöppler <[email protected]>
  • Loading branch information
theCalcaholic committed Aug 18, 2024
1 parent f623647 commit e3dd0f9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
15 changes: 13 additions & 2 deletions bin/ncp-update-nc
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,20 @@ BIN="${0##*/}"
VER="$1"
[[ "$VER" == "" ]] && { echo "Usage ${BIN} <version>"; exit 1; }

connect_to_nc_update() {
tail -f "/var/log/ncp-update-nc.log" &
tail_pid=$!
while systemctl is-active ncp-update-nc >/dev/null 2>&1
do
sleep 3
done
kill "$tail_pid"
}

if systemctl is-active ncp-update-nc >/dev/null 2>&1
then
echo "Existing ncp-update-nc process detected. Connecting..."
tail -f "/var/log/ncp-update-nc.log"
connect_to_nc_update
exit 0
fi

Expand All @@ -38,4 +48,5 @@ 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 change: 1 addition & 0 deletions build/armbian/armbian_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v24.08
2 changes: 1 addition & 1 deletion build/build-SD-armbian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e3dd0f9

Please sign in to comment.