SHARE
TWEET

BlockCountries Installation aid

a guest Nov 8th, 2010 471 Never
  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
RAW Paste Data
Top