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

#!/bin/bash
DIR="${0%/*}"
compile_template()
{
tr '\n' '|' | sed -e 's/\\/\\\\/g' -e 's/|*$//' -e 's/|/\\n/g' -e 's/$/\\n\n/' -e 's/&/\\&/g' -e 's/,/\\,/g'
}
for x in $DIR/*.in; do
name="$( echo "$x" | sed -e 's,.*/,,' -e 's,\.in$,,' | tr 'a-z' 'A-Z' )"
value="$( cat $x | compile_template )"
echo "s,@@$name@@,$value,g;"
done
sed -e '/^#/d;' -e 's,[ \t]*#.*,,' -e '/^[ \t]*$/d;' -e 's/=/ /' "$DIR/servers.txt" |
while read name value; do
echo "s,@@$name@@,$value,g;"
done