]> Cypherpunks.ru repositories - govpn.git/blobdiff - utils/newclient.sh
Ability to bind human readable name to the peer
[govpn.git] / utils / newclient.sh
index 620aac71538a6240294a4c7adc24f2577c5994c6..68469b66aa63047f9019937506dc9d2087ba3c7a 100755 (executable)
@@ -9,8 +9,8 @@ getrand()
 [ -n "$1" ] || {
     cat <<EOF
 Example script for creating new user peer for GoVPN.
-It just creates directory with random peer ID and random key in it,
-and adds empty file with human readable username.
+It just creates directory with random peer ID, random key,
+saves username in it and creates dummy up.sh executable script.
 
 Usage: $0 <username>
 EOF
@@ -22,5 +22,7 @@ peerid=$(getrand 16)
 umask 077
 mkdir -p peers/$peerid
 getrand 32 > peers/$peerid/key
-touch peers/$peerid/$1
-echo peers/$peerid/$1
+echo $username > peers/$peerid/name
+echo '#!/bin/sh' > peers/$peerid/up.sh
+chmod 700 peers/$peerid/up.sh
+echo $peerid