[arkdep] Ensure pkgs files are actually present
This commit is contained in:
parent
4e0a5d53aa
commit
2d02e146fd
1 changed files with 11 additions and 0 deletions
11
arkdep
11
arkdep
|
@ -535,6 +535,17 @@ get_update () {
|
||||||
mountinfo=${mountinfo%/*} # Remove everything after ID
|
mountinfo=${mountinfo%/*} # Remove everything after ID
|
||||||
declare -r deployment_id_old=${mountinfo##*/} # Remove everything before ID
|
declare -r deployment_id_old=${mountinfo##*/} # Remove everything before ID
|
||||||
|
|
||||||
|
# Check if pkgs files actually available
|
||||||
|
for id in "$deployment_id_old" "$deployment_id_new"; do
|
||||||
|
declare status_code=$(curl -s -o /dev/null --write-out "%{http_code}" $repo_url/$repo_default_image/$id.pkgs)
|
||||||
|
|
||||||
|
# Error if server returned a status code other than 200
|
||||||
|
if [[ $status_code -ne 200 ]]; then
|
||||||
|
printf "\e[1;31m<#>\e[0m Failed to download $id.pkgs file, server returned a status code of $status_code\e[0m\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
if [[ $deployment_id_old == $deployment_id_new ]]; then
|
if [[ $deployment_id_old == $deployment_id_new ]]; then
|
||||||
printf 'Already on latest version\n'
|
printf 'Already on latest version\n'
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue