Created
May 18, 2018 19:40
-
-
Save frayos/a0c39c8e3829e87797a6e59521086380 to your computer and use it in GitHub Desktop.
Official Yumrepocreation.sh
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/bash | |
# from https://go.documentation.sas.com/?docsetId=dplyml0phy0lax&docsetTarget=n1r12yogvmv19fn13dp89ulf1jlx.htm&docsetVersion=3.3&locale=en | |
sudo yum install yum-utils createrepo httpd | |
REPOLOC=/var/www/html/pulp/repos | |
ORDERABLE=$(grep METAREPO_SOE_ORDERABLE soe_defaults.yml | awk -F"'" '{ print $2 }') | |
# Make the directory that will house the yum repository | |
if [ ! -d ${REPOLOC} ]; then | |
mkdir -p ${REPOLOC} | |
fi | |
echo "" | |
echo "Unpack the files from repomirror.tar.gz" | |
tar xf repomirror.tar.gz -C ${REPOLOC} | |
echo "" | |
echo "Create the repository" | |
for repo in ${ORDERABLE}; do | |
NAME=$(sed -e 's/^"//' -e 's/"$//' <<<"$repo") | |
createrepo -v --update ${REPOLOC}/${NAME} -g ${REPOLOC}/${NAME}/comps.xml | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment