This is a simple script who creates a DVD Repository for your RHEL, just create a new file named repo_creator.sh, put this lines below into the file and run.
#!/bin/bash
echo " Midia está no driver ? (sim)"
read aceite
if test "$aceite" = sim
then
echo " Realizando instalacao…"
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
echo "[dvd]" > /etc/yum.repos.d/rhel-dvd.repo
echo "name=RHEL DVD" >> /etc/yum.repos.d/rhel-dvd.repo
echo "baseurl=file:///mnt/cdrom/Server" >> /etc/yum.repos.d/rhel-dvd.repo
echo "enabled=1" >> /etc/yum.repos.d/rhel-dvd.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/rhel-dvd.repo
yum update
else
exit
fi
