annotate scripts/add_udpmsg4_path @ 819:f1f0ab9d41b7 draft

i changed the she-bang on configure from sh to bash because it keeps giving people trouble: /CA/pikaj00> ./configure: 132: Bad substitution /CA/pikaj00> root@pikaj00-M-7323U:/services/ircd/resdb# /relayhell/d3v11> use /relayhell/d3v11> bash configure /relayhell/d3v11> did you run that command on slackware? /relayhell/d3v11> ./configure? /CA/pikaj00> sorry /CA/pikaj00> one sec /CA/pikaj00> yes /relayhell/d3v11> LOL /relayhell/d3v11> then the problem is not ubuntu or debian /CA/shuttle> =) /relayhell/d3v11> if slackware has the same problem /CA/pikaj00> bash /CA/shuttle> what do you think pik /CA/pikaj00> worked
author d3v11 <d3v11@d3v11.ano>
date Sat, 10 Dec 2011 22:23:18 +0000
parents a4e5033ce156
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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"