fixed bug 3259, remove the old yum repo before addsiteyum

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14684 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua 2012-12-19 07:53:43 +00:00
parent aadf88afd8
commit b1d7fe518d

View File

@ -1,15 +1,18 @@
#!/bin/sh
cd `dirname $0`
if [ ! -d repos/$OSVER/$ARCH ]; then
logger -t xcat "addsiteyum: repos/$OSVER/$ARCH is not a directory"
exit;
logger -t xcat -p local4.err "addsiteyum: repos/$OSVER/$ARCH is not a directory"
exit -1;
fi
for i in repos/$OSVER/$ARCH/*
do
if [ ! -r "$i" ]; then
continue
fi
rm -rf /etc/yum.repos.d/*
TARGFILE=`basename $i`
TARGFILE=`echo $TARGFILE|sed -e s/.tmpl$/.repo/`
sed -e s!#INSTSERVER#!$MASTER! $i > /etc/yum.repos.d/$TARGFILE
done
exit 0