Skip to content

Instantly share code, notes, and snippets.

@tpokorra
Last active December 17, 2015 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tpokorra/391ecd3e265b2447d778 to your computer and use it in GitHub Desktop.
Save tpokorra/391ecd3e265b2447d778 to your computer and use it in GitHub Desktop.
mkdir -p obs/kolab-3.4
cd obs/kolab-3.4
obsurl=http://obs.kolabsys.com/repositories/Kolab:/3.4/CentOS_7/src/
wget $obsurl -O index.html
# see http://unix.stackexchange.com/questions/181254/how-to-use-grep-and-cut-in-script-to-obtain-website-urls-from-an-html-file
for f in `cat index.html | grep rpm | grep -Eoi '<a [^>]+>' | grep -Eo 'href="[^\"]+"' | awk -F'"' '{ print $2}'`
do
wget $obsurl/$f
done
rm index.html
echo "put *src.rpm" | sftp tpokorra@fedorapeople.org:public_html/kolab/kolab-3.4
mkdir -p obs/kolab-3.4-updates
cd obs/kolab-3.4-updates
obsurl=http://obs.kolabsys.com/repositories/Kolab:/3.4:/Updates/CentOS_7/src/
wget $obsurl -O index.html
for f in `cat index.html | grep rpm | grep -Eoi '<a [^>]+>' | grep -Eo 'href="[^\"]+"' | awk -F'"' '{ print $2}'`
do
wget $obsurl/$f
done
rm index.html
echo "put *src.rpm" | sftp tpokorra@fedorapeople.org:public_html/kolab/kolab-3.4-updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment