[arkdep] Perform diff deployment_id check before connection check

This commit is contained in:
Dennis ten Hoove 2024-07-17 19:46:20 +02:00
parent 8af1ba9183
commit 47d2286dde
No known key found for this signature in database
GPG key ID: 2BA91DC2563B83D1

12
arkdep
View file

@ -597,6 +597,12 @@ diff () {
declare -r deployment_id_old=${mountinfo##*/} # Remove everything before ID
fi
# Check if we are already running the latest update
if [[ $deployment_id_old == $deployment_id_new ]]; then
printf 'Already on latest version\n'
exit 0
fi
# Check if pkgs files actually available
declare status_code_new=$(curl -s -o /dev/null --write-out "%{http_code}" $repo_url/$new_update_target/$deployment_id_new.pkgs)
@ -615,12 +621,6 @@ diff () {
exit 1
fi
# Check if we are already running the latest update
if [[ $deployment_id_old == $deployment_id_new ]]; then
printf 'Already on latest version\n'
exit 0
fi
# Get new package list
mapfile new_pkgs < <(curl -s $repo_url/$new_update_target/$deployment_id_new.pkgs)
# Get old package list