Mercurial > hg > anonet-resdb
comparison scripts/add_udpmsg4_path @ 603:a4e5033ce156 draft
welcome udpmsg4 paths to resdb :-)
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Fri, 09 Sep 2011 01:42:23 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
602:2d4ea8c6c34d | 603:a4e5033ce156 |
---|---|
1 #!/bin/sh | |
2 if [ x"$2" = x ]; then | |
3 echo "Usage: $0 <path> <owner> <key>" >&2; exit 255 | |
4 fi | |
5 path="$1" | |
6 owner="$2" | |
7 key="$3" | |
8 if [ "$(echo -n "$path" | tr -d '/A-Za-z0-9_-' | wc -c | tr -d ' \t')" != 0 ]; then | |
9 echo "udpmsg4 paths do not allow funny chars." >&2; exit 255 | |
10 fi | |
11 if [ "$(echo "$path" | head -c1)" != / ]; then | |
12 echo "udpmsg4 paths start with a slash." >&2; exit 255 | |
13 fi | |
14 fullpath=db/udpmsg4"$path" | |
15 mkdir -p "$fullpath" || exit 1 | |
16 mkdir "$fullpath/@" || exit 1 | |
17 echo "$key" >"$fullpath/@/default.key" | |
18 echo "$path" >"$fullpath/@/path" | |
19 echo "$owner" >"$fullpath/@/owner" | |
20 echo "temp.keys" >"$fullpath/@/.gitignore" | |
21 mkdir "$fullpath/@/temp.keys" | |
22 mkdir "$fullpath/@/blacklisted.keys" |