#!/usr/bin/bash
set -x
cd /root/bin
rm -rf /root/logs
mkdir /root/logs -pv			

BASEDIR="/arsiv/repo/rhel/rhel10"



if [ -f /var/run/repguncelle ]
then 
	echo basladik dedikya
else
touch /var/run/repguncelle


subscription-manager repos --disable=*

for rn in `cat repolist.txt`
do
	subscription-manager repos --enable=$rn
	echo $rn
	reposync --remote-time           --noautoremove --nogpgcheck  --bugfix  --enhancement               --security --downloadcomps --download-metadata --setopt=repo_id.module_hotfixes=1 --repo=$rn -p $BASEDIR | tee -a /root/logs/$rn.log.txt 
	reposync --remote-time  --source --noautoremove --nogpgcheck  --bugfix  --enhancement               --security --downloadcomps --download-metadata --setopt=repo_id.module_hotfixes=1 --repo=$rn -p $BASEDIR | tee -a /root/logs/$rn.log.txt

	subscription-manager repos --disable=$rn
done

subscription-manager repos --disable=*

subscription-manager repos --enable=codeready-builder-for-rhel-10-x86_64-rpms \
--enable=fast-datapath-for-rhel-10-x86_64-rpms \
--enable=rhel-10-for-x86_64-appstream-rpms \
--enable=rhel-10-for-x86_64-baseos-rpms \
--enable=rhel-10-for-x86_64-extensions-rpms \
--enable=rhel-10-for-x86_64-highavailability-rpms \
--enable=rhel-10-for-x86_64-nfv-rpms \
--enable=rhel-10-for-x86_64-rt-rpms \
--enable=rhel-10-for-x86_64-supplementary-rpms \
--enable=satellite-6-client-2-for-rhel-10-x86_64-rpms \
--enable=satellite-client-6-for-rhel-10-x86_64-rpms 

fi

