Update abra for new apps URL

This commit is contained in:
3wc 2021-04-18 03:39:45 +02:00
parent f0c80ee5b8
commit 75bd599a33

9
abra
View File

@ -1,6 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
GIT_URL="https://git.autonomic.zone/coop-cloud/" GIT_URL="https://git.autonomic.zone/coop-cloud/"
ABRA_APPS_URL="https://apps.coopcloud.tech"
ABRA_DIR="${ABRA_DIR:-$HOME/.abra}" ABRA_DIR="${ABRA_DIR:-$HOME/.abra}"
ABRA_VERSION="0.7.2" ABRA_VERSION="0.7.2"
ABRA_BACKUP_DIR="${ABRA_BACKUP_DIR:-$ABRA_DIR/backups}" ABRA_BACKUP_DIR="${ABRA_BACKUP_DIR:-$ABRA_DIR/backups}"
@ -484,10 +485,8 @@ require_apps_json() {
return return
fi fi
apps_url="https://abra-apps.cloud.autonomic.zone"
if [ -f "$ABRA_APPS_JSON" ]; then if [ -f "$ABRA_APPS_JSON" ]; then
modified=$(curl --silent --head $apps_url | \ modified=$(curl --silent --head "$ABRA_APPS_URL" | \
awk '/^Last-Modified/{print $0}' | \ awk '/^Last-Modified/{print $0}' | \
sed 's/^Last-Modified: //') sed 's/^Last-Modified: //')
remote_ctime=$(date --date="$modified" +%s) remote_ctime=$(date --date="$modified" +%s)
@ -495,13 +494,13 @@ require_apps_json() {
if [ "$local_ctime" -lt "$remote_ctime" ]; then if [ "$local_ctime" -lt "$remote_ctime" ]; then
info "Downloading new apps.json" info "Downloading new apps.json"
wget -qO "$ABRA_APPS_JSON" $apps_url wget -qO "$ABRA_APPS_JSON" "$ABRA_APPS_URL"
else else
debug "No apps.json update needed" debug "No apps.json update needed"
fi fi
else else
info "Downloading apps.json" info "Downloading apps.json"
wget -qO "$ABRA_APPS_JSON" $apps_url wget -qO "$ABRA_APPS_JSON" "$ABRA_APPS_URL"
fi fi
} }