From be65e69c3f933472c38bbd401b90e8f7e0cc75a0 Mon Sep 17 00:00:00 2001 From: backslashxx <118538522+backslashxx@users.noreply.github.com> Date: Tue, 24 Dec 2024 16:52:58 +0800 Subject: [PATCH] module/autopif: simplify download and messages --- module/autopif.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/module/autopif.sh b/module/autopif.sh index 682a167..b87269d 100644 --- a/module/autopif.sh +++ b/module/autopif.sh @@ -40,13 +40,12 @@ DIR="$MODPATH/autopif" mkdir -p "$DIR" cd "$DIR" -download https://developer.android.com/topic/generic-system-image/releases > PIXEL_GSI_HTML|| exit 1 +download https://developer.android.com/topic/generic-system-image/releases > PIXEL_GSI_HTML || { + echo "download failed!" + exit 0 + } grep -m1 -o 'li>.*(Beta)' PIXEL_GSI_HTML | cut -d\> -f2 - -BETA_REL_DATE="$(date -D '%B %e, %Y' -d "$(grep -m1 -o 'Date:.*' PIXEL_GSI_HTML | cut -d' ' -f2-4)" '+%Y-%m-%d')" -BETA_EXP_DATE="$(date -D '%s' -d "$(expr $(date -D '%Y-%m-%d' -d "$BETA_REL_DATE" '+%s') + 60 \* 60 \* 24 \* 7 \* 6)" '+%Y-%m-%d')" -echo "Beta Released: $BETA_REL_DATE" -echo "Estimated Expiry: $BETA_EXP_DATE" +grep -m1 -o 'Date:.*' PIXEL_GSI_HTML RELEASE="$(grep -m1 'corresponding Google Pixel builds' PIXEL_GSI_HTML | grep -o '/versions/.*' | cut -d/ -f3)" ID="$(grep -m1 -o 'Build:.*' PIXEL_GSI_HTML | cut -d' ' -f2)"