test.sh 564 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. OPTS="-o Dir::Etc::sourcelist=./sources.test.list -o Acquire::http::timeout=20"
  3. # setup
  4. unset http_proxy
  5. iptables --flush
  6. echo "No network at all"
  7. ifdown eth0
  8. time apt-get update $OPTS 2>&1 |grep system
  9. ifup eth0
  10. echo ""
  11. echo "no working DNS (port 53 DROP)"
  12. iptables -A OUTPUT -p udp --dport 53 -j DROP
  13. time apt-get update $OPTS 2>&1 |grep system
  14. iptables --flush
  15. echo ""
  16. echo "DNS but no access to archive.ubuntu.com (port 80 DROP)"
  17. iptables -A OUTPUT -p tcp --dport 80 -j DROP
  18. time apt-get update $OPTS 2>&1 |grep system
  19. iptables --flush
  20. echo ""