Guest User

Untitled

a guest
Jul 17th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. CONFFILE="/local/etc/fetchextras.conf" # can be overridden
  4. TARGETDIR="/tmp/repodl"
  5.  
  6. read_config() {
  7. [[ -r $CONFFILE ]] || { echo "Can't read $CONFFILE, giving up..."; exit 1; }
  8. while read type value
  9. do
  10. [[ "$type" = "repo" ]] && ENABLE="--enablerepo $value $ENABLE"
  11. [[ "$type" = "package" ]] && PKGS="$value $PKGS"
  12. done < $CONFFILE
  13. }
  14.  
  15.  
  16. fetch_packages() {
  17. for pkg in $PKGS
  18. do
  19. yumdownloader -q -y --destdir=$TARGETDIR --disablerepo=* --resolve $ENABLE $pkg
  20. done
  21. }
  22.  
  23. get_options() {
  24. CONFFILE=${1:-$CONFFILE}
  25. }
  26.  
  27. get_options $@
  28. read_config
  29. fetch_packages
  30.  
  31. repo epel
  32. package whatever
  33.  
  34. spacecmd {SSM:2}> repo_listfilters epel-6-64
  35. spacecmd {SSM:2}> repo_addfilters epel-6-64 '+tomcat'
  36. spacecmd {SSM:2}> repo_listfilters epel-6-64
  37. +tomcat
  38. spacecmd {SSM:2}> repo_clearfilters epel-6-64
  39. spacecmd {SSM:2}> repo_listfilters epel-6-64
  40. spacecmd {SSM:2}>
  41.  
  42. cobbler repo edit --name epel-6-64 --rpm-list 'tomcat'
Add Comment
Please, Sign In to add comment