[root@httpd1 ~]# cat yum_config.sh
#!/bin/bash
FILE1=/etc/yum.conf
FILE2=/usr/lib/python2.4/site-packages/yum/yumRepo.py
echo "Config the file $FILE1 ..."
#sed -i 's/^gpgcheck=0/gpgcheck=1/' $FILE1
sed -i '/^gpgcheck/s/1/0/' $FILE1
echo "[iso]" >> $FILE1
echo "name=rhel" >> $FILE1
echo "baseurl=file:///misc/Server" >> $FILE1
echo "Config the file $FILE2 ..."
sed -i "/relative$/s/url/\'\/misc\/Server\'/" $FILE2
#echo "Mount disk and iso to /mnt and /misc ..."
#mount //192.168.0.21/purpose /mnt -o username=steve,passwd=steve
#mount /mnt/RHEL* /misc -o loop
#echo "Mount OK!"
#yum list
echo "Anything is OK!"
阅读(580) | 评论(0) | 转发(0) |