comparison scripts/add_udpmsg4_chat @ 1020:bace90f3f318 draft

[scripts/add_udpmsg4_chat] [security] .gitignore seckey (thanks Ivo)
author d3v11 <d3v11@d3v11.ano>
date Sat, 06 Oct 2012 22:06:10 +0000
parents 115f429c1758
children 9c22f6ca8b1f
comparison
equal deleted inserted replaced
1019:1219afbcefbd 1020:bace90f3f318
1 #!/bin/sh 1 #!/bin/sh
2 if [ -z $3 ]; then 2 if [ -z $5 ]; then
3 echo "Usage: $0 <chat> <owner> <pubkey> <seckey>" >&2; exit 255 3 echo "Usage: $0 <chat> <owner> <pubkey> <seckey> <topic>" >&2; exit 255
4 fi 4 fi
5 chat="$1" 5 chat="$1"
6 owner="$2" 6 owner="$2"
7 pubkey="$3" 7 pubkey="$3"
8 seckey="$4" 8 seckey="$4"
9 topic="$5"
9 10
10 if [ "$(echo -n "${chat/chat\//}" | tr -d 'A-Za-z0-9_-' | wc -c | tr -d ' \t')" != 0 ]; then 11 if [ "$(echo -n "${chat/chat\//}" | tr -d 'A-Za-z0-9_-' | wc -c | tr -d ' \t')" != 0 ]; then
11 echo "udpmsg4 chats do not allow funny chars." >&2; exit 255 12 echo "udpmsg4 chats do not allow funny chars." >&2; exit 255
12 fi 13 fi
13 if ((`echo -n "${chat/chat\//}" | wc -c` > 32)); then 14 if ((`echo -n "${chat/chat\//}" | wc -c` > 32)); then
27 mkdir -p $fullchat || exit 1 28 mkdir -p $fullchat || exit 1
28 mkdir -p $fullchat/@ || exit 1 29 mkdir -p $fullchat/@ || exit 1
29 echo -n "$owner" >"$fullchat/@/owner" 30 echo -n "$owner" >"$fullchat/@/owner"
30 echo -n "$pubkey" >"$fullchat/@/pubkey" 31 echo -n "$pubkey" >"$fullchat/@/pubkey"
31 echo -n "$seckey" >"$fullchat/@/seckey" 32 echo -n "$seckey" >"$fullchat/@/seckey"
33 echo -n "$topic" >"$fullchat/@/topic"
34 echo -n "seckey" >"$fullchat/@/.gitignore"