samir82show

rpm archiver

Aug 9th, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. if [ $# -ne 1 ]
  4. then
  5. echo "usage $0 URL"
  6. exit 1
  7. fi
  8.  
  9. url=$1
  10. curl $url > /tmp/unprocess.rpm.files
  11. ./word_proc < /tmp/unprocess.rpm.files > /tmp/refined.rpm.files
  12. total_rpms=`wc -l /tmp/refined.rpm.files | awk -F' ' '{print $1}'`
  13. remained_rpms=$total_rpms
  14.  
  15. for i in `cat /tmp/refined.rpm.files`
  16. do
  17. echo "total $total_rpms remained $remained_rpms"
  18. curl -O ${url}/${i}
  19. remained_rpms=`echo $remained_rpms - 1 | bc`
  20. done
Advertisement
Add Comment
Please, Sign In to add comment