Mercurial > hg > anonet-resdb
annotate scripts/add_dom @ 1131:16cef39f682d draft
Added a whoisd to make for easier querying of the resdb's info. Read the source.
author | epoch <epoch@hacking.allowed.org> |
---|---|
date | Fri, 23 Aug 2013 03:24:54 +0000 |
parents | 8e01b8361e9e |
children |
rev | line source |
---|---|
19
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
1 #!/bin/sh |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
2 |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
3 if [ x"$2" = x ]; then |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
4 echo "Usage: $0 <dom> <owner> [<ns[/nsip]>...]" >&2; exit 255 |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
5 fi |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
6 |
1120
8e01b8361e9e
changed add_dom to not even bother with anything head -c -1 related. should still work.
epoch <epoch@hacking.allowed.org>
parents:
1119
diff
changeset
|
7 dir=db/dom/"$(echo "$1" | tr . '\n' | tac | tr '\n' / )" |
1116 | 8 mkdir -p "$dir" || exit 1 |
1120
8e01b8361e9e
changed add_dom to not even bother with anything head -c -1 related. should still work.
epoch <epoch@hacking.allowed.org>
parents:
1119
diff
changeset
|
9 echo "$2" > "${dir}owner" |
8e01b8361e9e
changed add_dom to not even bother with anything head -c -1 related. should still work.
epoch <epoch@hacking.allowed.org>
parents:
1119
diff
changeset
|
10 mkdir "${dir}ns" || exit 1 |
19
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
11 shift; shift; |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
12 while [ x"$1" != x ]; do |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
13 echo "$1" | tr / ' ' | ( |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
14 read ns nsip |
1120
8e01b8361e9e
changed add_dom to not even bother with anything head -c -1 related. should still work.
epoch <epoch@hacking.allowed.org>
parents:
1119
diff
changeset
|
15 echo "$nsip" > "${dir}ns/$ns" |
19
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
16 ) |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
17 shift; |
31e3b4edf502
scripts for dom&ip, dn42 resdb, and doc (www.anonet2.org)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
18 done |