testurls.sh 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. #called from /usr/local/petget/downloadpkgs.sh
  3. #/tmp/petget_repos has the list of repos, each line in this format:
  4. #repository.slacky.eu|http://repository.slacky.eu/slackware-12.2|Packages-slackware-12.2-slacky
  5. #...only the first field is of interest in this script.
  6. echo '#!/bin/sh' > /tmp/petget_urltest
  7. echo 'echo "Testing the URLs:"' >> /tmp/petget_urltest
  8. for ONEURLSPEC in `cat /tmp/petget_repos`
  9. do
  10. URL_TEST="`echo -n "$ONEURLSPEC" | cut -f 1 -d '|'`"
  11. #[ "`wget -t 2 -T 20 --waitretry=20 --spider -S $ONE_PET_SITE -o /dev/stdout 2>/dev/null | grep '200 OK'`" != "" ]
  12. echo 'echo' >> /tmp/petget_urltest
  13. echo "wget -t 2 -T 20 --waitretry=20 --spider -S $URL_TEST" >> /tmp/petget_urltest
  14. done
  15. echo 'echo "
  16. TESTING FINISHED
  17. Read the above, any that returned \"200 OK\" succeeded."' >> /tmp/petget_urltest
  18. echo 'echo -n "Press ENTER key to exit: "
  19. read ENDIT' >> /tmp/petget_urltest
  20. chmod 777 /tmp/petget_urltest
  21. rxvt -title "Puppy Package Manager: download" -bg orange -fg black -e /tmp/petget_urltest
  22. ###END###