Mercurial > hg > anonet-resdb
comparison scripts/add_dom @ 1120:8e01b8361e9e draft
changed add_dom to not even bother with anything head -c -1 related. should still work.
added a comment at the top of dec2hex to suggest a shorter version that should work.
added a script for generating zonefiles for bind
author | epoch <epoch@hacking.allowed.org> |
---|---|
date | Mon, 27 May 2013 05:16:01 +0000 |
parents | 5645d1ed79c5 |
children |
comparison
equal
deleted
inserted
replaced
1119:5645d1ed79c5 | 1120:8e01b8361e9e |
---|---|
2 | 2 |
3 if [ x"$2" = x ]; then | 3 if [ x"$2" = x ]; then |
4 echo "Usage: $0 <dom> <owner> [<ns[/nsip]>...]" >&2; exit 255 | 4 echo "Usage: $0 <dom> <owner> [<ns[/nsip]>...]" >&2; exit 255 |
5 fi | 5 fi |
6 | 6 |
7 dir=db/dom/"$(echo "$1" | tr . '\n' | tac | tr '\n' / | ./scripts/head_-c_-1)" | 7 dir=db/dom/"$(echo "$1" | tr . '\n' | tac | tr '\n' / )" |
8 mkdir -p "$dir" || exit 1 | 8 mkdir -p "$dir" || exit 1 |
9 echo "$2" > "$dir/owner" | 9 echo "$2" > "${dir}owner" |
10 mkdir "$dir/ns" || exit 1 | 10 mkdir "${dir}ns" || exit 1 |
11 shift; shift; | 11 shift; shift; |
12 while [ x"$1" != x ]; do | 12 while [ x"$1" != x ]; do |
13 echo "$1" | tr / ' ' | ( | 13 echo "$1" | tr / ' ' | ( |
14 read ns nsip | 14 read ns nsip |
15 echo "$nsip" > "$dir/ns/$ns" | 15 echo "$nsip" > "${dir}ns/$ns" |
16 ) | 16 ) |
17 shift; | 17 shift; |
18 done | 18 done |