Advertisement
goebelmasse

generator

Jan 25th, 2021
1,904
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.64 KB | None | 0 0
  1. #!/bin/sh
  2. ########################################################################
  3. #
  4. # generator
  5. # $Id: generator,v 1.2 2021/01/25 21:29:37 elias Exp $
  6. #
  7. # Extract the generator-metatag from a web site.
  8. # Requires GNU sed for the "i" modifier of sed. Yes, I know... ;)
  9. #
  10. ########################################################################
  11.  
  12. PATH=/bin:/usr/bin
  13.  
  14. for i in "$@"
  15. do
  16.     echo -n "$i\t"
  17.     line=`curl -s "$i" | grep -i \<meta | grep -i generator | sed 1q`
  18.     if [ -z "$line" ]
  19.     then
  20.     echo "WARNING: no generator specified"
  21.     else
  22.     echo $line | sed "s/^.*content=['\"]\\([^'\"]*\\)['\"].*$/\\1/i"
  23.     fi
  24. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement