This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

BlockCountries Installation aid

By: a guest on Nov 8th, 2010  |  syntax: None  |  size: 0.60 KB  |  views: 443  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. if ! which perl > /dev/null 2>&1 ; then
  4.     echo "You need to install perl"
  5.     exit 1
  6. fi
  7.  
  8. function needs {
  9.     m="$1"
  10.     if ! perl -m"$m" -e'exit;' >/dev/null 2>&1 ; then
  11.         echo "You need to install the perl module $m"
  12.         echo "Fetch it from your distribution or from cpan"
  13.         exit 1
  14.     fi
  15.     return 0
  16. }
  17.  
  18. needs File::Basename
  19. needs File::Path
  20. needs IO::Uncompress::Gunzip
  21. needs Locale::Country
  22. needs LWP::Simple
  23. needs NetAddr::IP
  24. needs Net::Domain
  25. needs Parse::Syslog
  26. needs POSIX
  27. needs Text::ParseWords
  28.  
  29. echo "All needed perl modules are installed"
  30.  
  31. exit 0
clone this paste RAW Paste Data