DNS data
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
483 B

  1. #!/bin/bash
  2. DIR="${0%/*}"
  3. compile_template()
  4. {
  5. tr '\n' '|' | sed -e 's/\\/\\\\/g' -e 's/|*$//' -e 's/|/\\n/g' -e 's/$/\\n\n/' -e 's/&/\\&/g' -e 's/,/\\,/g'
  6. }
  7. for x in $DIR/*.in; do
  8. name="$( echo "$x" | sed -e 's,.*/,,' -e 's,\.in$,,' | tr 'a-z' 'A-Z' )"
  9. value="$( cat $x | compile_template )"
  10. echo "s,@@$name@@,$value,g;"
  11. done
  12. sed -e '/^#/d;' -e 's,[ \t]*#.*,,' -e '/^[ \t]*$/d;' -e 's/=/ /' "$DIR/servers.txt" |
  13. while read name value; do
  14. echo "s,@@$name@@,$value,g;"
  15. done