Last active
          December 17, 2015 04:26 
        
      - 
      
- 
        Save tpokorra/391ecd3e265b2447d778 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
    
  
  
    
  | 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 [email protected]: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 [email protected]: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