#!/bin/bash

PKGS="libsodium re2 jemalloc compat-lua compat-lua-libs lua-sec lua-socket libzstd yaml-cpp udns libdev fstrm dnsperf tcpreplay"

cd /var/www/share/third-party-packages-8
for pkg in $PKGS
do
	yumdownloader --disablerepo='*' --enablerepo=epel-8 $pkg
done

PKGS="openresty openresty-openssl111 openresty-pcre openresty-zlib"
for pkg in $PKGS
do
        yumdownloader --releasever=8 --disablerepo='*' --enablerepo=openresty $pkg
done

PKGS="postgresql10-10.14 postgresql10-libs-10.14 postgresql10-server-10.14 python3-psycopg2 repmgr10"
for pkg in $PKGS
do
        yumdownloader --disablerepo='*' --enablerepo=pgdg10 $pkg
done

PKGS="grafana"
for pkg in $PKGS
do
        yumdownloader --releasever=8 --disablerepo='*' --enablerepo=grafana-stable $pkg
done

PKGS="prometheus2 alertmanager blackbox_exporter pushgateway"
for pkg in $PKGS
do
        yumdownloader --releasever=8 --disablerepo='*' --enablerepo=prometheus $pkg
done

PKGS="dnsmeter"
for pkg in $PKGS
do
        yumdownloader --releasever=8 --disablerepo='*' --enablerepo=dnsoarc-dnsmeter $pkg
done


BASEURL="https://share.presales.powerdns.equipment/third-party-packages-8"
ls -1 | while read line
do
	echo "'$BASEURL/$line',"
done

