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

BASEDIR="/repo/rhel9"



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=ansible-automation-platform-2.4-for-rhel-9-x86_64-source-rpms --enable=ansible-automation-platform-2.4-for-rhel-9-x86_64-rpms \
--enable=rhel-9-for-x86_64-supplementary-rpms \
--enable=rhel-9-for-x86_64-resilientstorage-rpms \
--enable=rhel-9-for-x86_64-nfv-rpms \
--enable=rhel-9-for-x86_64-highavailability-rpms \
--enable=rhel-9-for-x86_64-baseos-rpms \
--enable=rhel-9-for-x86_64-appstream-rpms \
--enable=rh-sso-7.6-for-rhel-9-x86_64-rpms \
--enable=jws-5-for-rhel-9-x86_64-rpms \
--enable=jb-eap-7.4-for-rhel-9-x86_64-rpms \
--enable=jb-datagrid-8.4-for-rhel-9-x86_64-rpms \
--enable=fast-datapath-for-rhel-9-x86_64-rpms \
--enable=dirsrv-12-for-rhel-9-x86_64-rpms \
--enable=codeready-builder-for-rhel-9-x86_64-rpms

fi

