mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-28 19:34:05 +02:00
Update daily_README.yaml
This commit is contained in:
12
.github/workflows/daily_README.yaml
vendored
12
.github/workflows/daily_README.yaml
vendored
@@ -49,30 +49,34 @@ jobs:
|
|||||||
|
|
||||||
# Go through all folders, add to filters if not existing
|
# Go through all folders, add to filters if not existing
|
||||||
for f in $( find -- * -maxdepth 0 -type d | sort -r ); do
|
for f in $( find -- * -maxdepth 0 -type d | sort -r ); do
|
||||||
|
DOWNLOADS=0
|
||||||
if [ -f "$f"/config.json ]; then
|
if [ -f "$f"/config.json ]; then
|
||||||
SLUG=$(jq -r '.image' "$f/config.json" | awk -F 'alexbelgium/|-{arch' '{print $2}')
|
SLUG=$(jq -r '.image' "$f/config.json" | awk -F 'alexbelgium/|-{arch' '{print $2}')
|
||||||
if [[ $(jq '.arch[]' "$f/config.json") == *"armv7"* ]]; then
|
if [[ $(jq '.arch[]' "$f/config.json") == *"armv7"* ]]; then
|
||||||
ARCH=armv7 && COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
ARCH=armv7 && COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
||||||
if [ -z "$COUNT" ]; then echo "$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}')"; fi
|
if [ -z "$COUNT" ]; then echo "$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}')"; fi
|
||||||
COUNT1="$COUNT"
|
COUNT1="$COUNT"
|
||||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"; fi
|
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||||
|
else COUNT1="-"; fi
|
||||||
if [[ $(jq '.arch[]' "$f/config.json") == *"amd64"* ]]; then
|
if [[ $(jq '.arch[]' "$f/config.json") == *"amd64"* ]]; then
|
||||||
ARCH=amd64 && COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
ARCH=amd64 && COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
||||||
until [ ! -z "$COUNT" ]; do COUNT="$(curl -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; done
|
until [ ! -z "$COUNT" ]; do COUNT="$(curl -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; done
|
||||||
COUNT2="$COUNT"
|
COUNT2="$COUNT"
|
||||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"; fi
|
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||||
|
else COUNT2="-"; fi
|
||||||
if [[ $(jq '.arch[]' "$f/config.json") == *"aarch64"* ]]; then
|
if [[ $(jq '.arch[]' "$f/config.json") == *"aarch64"* ]]; then
|
||||||
ARCH=aarch64 && COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
ARCH=aarch64 && COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
||||||
if [ -z "$COUNT" ]; then echo "$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}')"; fi
|
if [ -z "$COUNT" ]; then echo "$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}')"; fi
|
||||||
COUNT3="$COUNT"
|
COUNT3="$COUNT"
|
||||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))";fi
|
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||||
|
else COUNT3="-";fi
|
||||||
echo "$SLUG $DOWNLOADS $COUNT1 $COUNT2 $COUNT3" >> Stats
|
echo "$SLUG $DOWNLOADS $COUNT1 $COUNT2 $COUNT3" >> Stats
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Make stats
|
# Make stats
|
||||||
|
|
||||||
sort -k2,2 -n Stats > tmp && mv tmp Stats
|
sort -k2,2 -r -n Stats > tmp && mv tmp Stats
|
||||||
sed -i "1i Name Total armv7 amd64 aarch64" Stats
|
sed -i "1i Name Total armv7 amd64 aarch64" Stats
|
||||||
TOTAL="$(awk '{SUM+=$2}END{print SUM}' Stats)"
|
TOTAL="$(awk '{SUM+=$2}END{print SUM}' Stats)"
|
||||||
TOTAL1="$(awk '{SUM+=$2}END{print SUM}' Stats)"
|
TOTAL1="$(awk '{SUM+=$2}END{print SUM}' Stats)"
|
||||||
|
|||||||
Reference in New Issue
Block a user