2008-03-26 15:04:32 +00:00
|
|
|
#!/bin/sh
|
2008-03-26 15:39:32 +00:00
|
|
|
cd `dirname $0`
|
|
|
|
if [ ! -d repos/$OSVER/$ARCH ]; then
|
2012-05-15 06:57:51 +00:00
|
|
|
logger -t xcat -p local4.err "addsiteyum: repos/$OSVER/$ARCH is not a directory"
|
2012-11-22 07:59:03 +00:00
|
|
|
exit -1;
|
2008-03-26 15:39:32 +00:00
|
|
|
fi
|
|
|
|
for i in repos/$OSVER/$ARCH/*
|
2008-03-26 15:04:32 +00:00
|
|
|
do
|
2008-03-26 15:39:32 +00:00
|
|
|
if [ ! -r "$i" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
2008-03-26 15:04:32 +00:00
|
|
|
TARGFILE=`basename $i`
|
2008-03-26 15:39:32 +00:00
|
|
|
TARGFILE=`echo $TARGFILE|sed -e s/.tmpl$/.repo/`
|
|
|
|
sed -e s!#INSTSERVER#!$MASTER! $i > /etc/yum.repos.d/$TARGFILE
|
2013-03-14 02:29:50 +00:00
|
|
|
|
|
|
|
# disable the internet repos which are created by addsiteyum
|
|
|
|
if [ -r "/etc/yum.repos.d/CentOS-Base.repo" ]; then
|
|
|
|
TMP=`sed -e '/enabled/d' /etc/yum.repos.d/CentOS-Base.repo | sed -e '/^gpgkey/i enabled=0'`
|
|
|
|
echo "$TMP" > /etc/yum.repos.d/CentOS-Base.repo
|
|
|
|
fi
|
|
|
|
|
2008-03-26 15:04:32 +00:00
|
|
|
done
|
2012-11-22 07:59:03 +00:00
|
|
|
|
|
|
|
exit 0
|