#!/usr/bin/env bash repo="azlux/nft-stats" api=$(curl --silent "https://api.github.com/repos/$repo/releases/latest") new=$(echo $api | grep -Po '"tag_name": "\K.*?(?=")') current=$(reprepro -b /var/www/repos/apt/debian list stable nft-stats | head -n1| awk '{print $3}') [ "$current" == "$new" ] && exit 0 echo "MAJ depot NFT-STATS version $current -> $new" wget -q https://github.com/azlux/nft-stats/archive/$new.tar.gz -O /tmp/nft-stats.tar.gz tar xf /tmp/nft-stats.tar.gz -C /tmp /tmp/nft-stats-$new/build-packages.sh reprepro -b /var/www/repos/apt/debian includedeb stable /tmp/nft-stats-$new/deb/*.deb reprepro -b /var/www/repos/apt/debian includedeb oldstable /tmp/nft-stats-$new/deb/*.deb rm -r /tmp/nft-stats-$new rm /tmp/nft-stats.tar.gz