Mercurial > hg > anonet-resdb
annotate scripts/add_udpmsg4_path @ 770:2587c6d6204a draft
fixed href link for Async search engine.
author | d3v11 <d3v11@d3v11.ano> |
---|---|
date | Mon, 21 Nov 2011 19:50:39 +0000 |
parents | a4e5033ce156 |
children |
rev | line source |
---|---|
603
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
1 #!/bin/sh |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
2 if [ x"$2" = x ]; then |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
3 echo "Usage: $0 <path> <owner> <key>" >&2; exit 255 |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
4 fi |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
5 path="$1" |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
6 owner="$2" |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
7 key="$3" |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
8 if [ "$(echo -n "$path" | tr -d '/A-Za-z0-9_-' | wc -c | tr -d ' \t')" != 0 ]; then |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
9 echo "udpmsg4 paths do not allow funny chars." >&2; exit 255 |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
10 fi |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
11 if [ "$(echo "$path" | head -c1)" != / ]; then |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
12 echo "udpmsg4 paths start with a slash." >&2; exit 255 |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
13 fi |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
14 fullpath=db/udpmsg4"$path" |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
15 mkdir -p "$fullpath" || exit 1 |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
16 mkdir "$fullpath/@" || exit 1 |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
17 echo "$key" >"$fullpath/@/default.key" |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
18 echo "$path" >"$fullpath/@/path" |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
19 echo "$owner" >"$fullpath/@/owner" |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
20 echo "temp.keys" >"$fullpath/@/.gitignore" |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
21 mkdir "$fullpath/@/temp.keys" |
a4e5033ce156
welcome udpmsg4 paths to resdb :-)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
22 mkdir "$fullpath/@/blacklisted.keys" |