Created
October 11, 2017 03:15
-
-
Save kjelly/6d7c9847dc462d83e4c2eb9120d59cd5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
REPODIR="$HOME/osprepo" | |
REPOFILE="$HOME/osp.repo" | |
rm $REPOFILE 2> /dev/null | |
rm -rf /etc/yum.repos.d/* | |
touch $REPOFILE | |
for DIR in `find $REPODIR -maxdepth 1 -mindepth 1 -type d`; do | |
echo -e "[`basename $DIR`]" >> $REPOFILE | |
echo -e "name=`basename $DIR`" >> $REPOFILE | |
echo -e "baseurl=file://$REPODIR/`basename $DIR`/" >> $REPOFILE | |
echo -e "enabled=1" >> $REPOFILE | |
echo -e "gpgcheck=0" >> $REPOFILE | |
echo -e "gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release" >> $REPOFILE | |
echo -e "\n" >> $REPOFILE | |
done; | |
cp $REPOFILE /etc/yum.repos.d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment