Created
May 18, 2018 19:38
-
-
Save frayos/d0132df60d1a341305e281d9b6b0d0c3 to your computer and use it in GitHub Desktop.
Official createrepos.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 | |
cp customized_deployment_script.sh setup_repos.sh | |
sed -i -e 's/^\s*yum groupinstall/#yum groupinstall/' setup_repos.sh | |
./setup_repos.sh | |
MIRRORLOC=/opt/sas/repomirror | |
if [ ! -d ${MIRRORLOC} ]; then | |
mkdir -p ${MIRRORLOC} | |
fi | |
for f in $(ls /etc/yum.repos.d/sas-*.repo | cut -f4 -d/ | sed s/.repo//g | grep -v sas-meta) | |
do | |
reposync -n -d -m --repoid=${f} --download_path=${MIRRORLOC} --download-metadata | |
done | |
cd ${MIRRORLOC} | |
tar -zcvf repomirror.tar.gz sas-* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment