testurls.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. echo '[ "$(cat /var/local/petget/nt_category 2>/dev/null)" != "true" ] && [ -f /tmp/install_quietly ] && set -x' >> /tmp/petget_urltest
  9. for ONEURLSPEC in `cat /tmp/petget_repos`
  10. do
  11. URL_TEST="`echo -n "$ONEURLSPEC" | cut -f 1 -d '|'`"
  12. #[ "`wget -t 2 -T 20 --waitretry=20 --spider -S $ONE_PET_SITE -o /dev/stdout 2>/dev/null | grep '200 OK'`" != "" ]
  13. echo 'echo' >> /tmp/petget_urltest
  14. echo "wget -t 2 -T 20 --waitretry=20 --spider -S $URL_TEST" >> /tmp/petget_urltest
  15. done
  16. echo 'echo "
  17. TESTING FINISHED
  18. Read the above, any that returned \"200 OK\" succeeded."' >> /tmp/petget_urltest
  19. echo 'echo -n "Press ENTER key to exit: "
  20. read ENDIT' >> /tmp/petget_urltest
  21. chmod 777 /tmp/petget_urltest
  22. if [ ! -f /tmp/install_quietly ]; then
  23. rxvt -title "Puppy Package Manager: download" -bg orange \
  24. -fg black -e /tmp/petget_urltest
  25. else
  26. exec /tmp/petget_urltest
  27. fi
  28. ###END###