#!/bin/bash
set -x
cd /home/repbooti/domains/rep-booting.upress.io/public_html/CentOS/7/x86_64/Packages
rm -f *.rpm
wget https://updates.booting.me/rpm/hash -O hashes.txt
for i in $(cat hashes.txt | awk '{print $3}') ; do
        until [ "$(sha256sum $i | awk '{print $1}')" = "$(grep $i hashes.txt | awk '{print $1}')" ] ; do
                wget https://updates.booting.me/rpm/$(grep $i hashes.txt | awk '{print $2}')/latest/download -O $i
        done
done
createrepo --update `pwd`
chown -R repbooti:repbooti *
