Remove armv7 from stats and README

This commit is contained in:
Alexandre
2025-11-27 09:57:34 +01:00
parent 70e92d6595
commit bea03a3b1e
4 changed files with 120 additions and 251 deletions

View File

@@ -19,7 +19,6 @@ jobs:
COUNT=0
COUNT1=0
COUNT2=0
COUNT3=0
# Make sure file exists
file=Stats
touch "$file"
@@ -38,7 +37,6 @@ jobs:
DOWNLOADS=0
COUNT1="-"
COUNT2="-"
COUNT3="-"
IMAGE=""
ARCHES=""
if [ -f "$f"/config.json ] && jq -e '.image' "$f/config.json" >/dev/null; then
@@ -56,28 +54,21 @@ jobs:
SLUG=""
fi
if [ -n "$SLUG" ]; then
if printf '%s\n' "$ARCHES" | grep -qx 'armv7'; then
ARCH=armv7 && COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
if printf '%s\n' "$ARCHES" | grep -qx 'amd64'; then
ARCH=amd64 && COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
until [ -n "$COUNT" ]; do COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')" && sleep 5; ((c++)) && echo "repeat $c" && if [[ "$c" == 10 ]]; then COUNT=0; fi; done
COUNT="${COUNT//,/}"
COUNT1="$COUNT"
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
else COUNT1="-"; fi
if printf '%s\n' "$ARCHES" | grep -qx 'amd64'; then
ARCH=amd64 && COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
until [ -n "$COUNT" ]; do COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')" && sleep 5; ((c++)) && echo "repeat $c" && if [[ "$c" == 10 ]]; then COUNT=0; fi; done
COUNT="${COUNT//,/}"
COUNT2="$COUNT"
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
else COUNT2="-"; fi
if printf '%s\n' "$ARCHES" | grep -qx 'aarch64'; then
ARCH=aarch64 && COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
until [ -n "$COUNT" ]; do COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')" && sleep 5; ((c++)) && echo "repeat $c" && if [[ "$c" == 10 ]]; then COUNT=0; fi; done
COUNT="${COUNT//,/}"
COUNT3="$COUNT"
COUNT2="$COUNT"
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
else COUNT3="-";fi
echo "$SLUG $DOWNLOADS $COUNT1 $COUNT2 $COUNT3" >> "$file"2
else COUNT2="-";fi
echo "$SLUG $DOWNLOADS $COUNT1 $COUNT2" >> "$file"2
# Create line if not existing
if ! grep -q "${SLUG}$" "$file"; then
sed -i "\$a$SLUG" "$file"
@@ -110,7 +101,7 @@ jobs:
# Sort file
(head -n 2 "$file" && tail -n +3 "$file" | sort -k1 -r -n) > tmp && mv tmp "$file"
sed -i "1i Name Total armv7 amd64 aarch64" "$file"2
sed -i "1i Name Total amd64 aarch64" "$file"2
sed -i "1a ------------------------------" "$file"2
#TOTAL="$(awk '{SUM+=$2}END{print SUM}' Stats)"
#TOTAL1="$(awk '{SUM+=$2}END{print SUM}' Stats)"