mirror-advisories.sh 943 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. # init values for when to start fetching - auto-updated by $config below
  3. dsa=2202
  4. usn=1179
  5. mirror=/srv/http/htdocs/apt-sec/mirror
  6. config=$mirror/advisory_states.conf
  7. . $config
  8. echo "Mirroring advisories..."
  9. ## Debian
  10. #rm -f "$mirror/dsa/2011/dsa-$(printf "%03d" $dsa)" || true;
  11. while (wget -cqx -P "$mirror/dsa/" -nH --cut-dirs=1 "http://www.debian.org/security/2012/dsa-$(printf "%03d" $dsa)"); do
  12. echo "Got Debian DSA $dsa"
  13. let dsa++;
  14. done
  15. cd ..
  16. ## Ubuntu
  17. #rm "$mirror/usn/usn-$(printf "%03d" $usn)-1"
  18. while (wget -cqx -P "$mirror/usn" -nH --cut-dirs=1 "http://www.ubuntu.com/usn/usn-$usn-1"); do
  19. echo "Got Ubuntu USN $usn"
  20. let usn++;
  21. done
  22. # save new dsa/usn status
  23. (echo dsa=$dsa; echo usn=$usn ) > $config
  24. # mirror all FreeBSD advisories
  25. # TODO: make this more clever so we don't touch everything all the time..
  26. #wget -P "$mirror/fsa" -nH --cut-dirs=1 -rc -A '*.asc' -l 1 http://security.freebsd.org/advisories/