diff options
author | LRN <lrn1986@gmail.com> | 2013-12-22 14:31:00 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-12-22 14:31:00 +0000 |
commit | caf3ec1710d8e0964790fb8691a7ea8d51690513 (patch) | |
tree | f16e8b969dae6ba836a48123ea75252b974e0c72 /contrib | |
parent | 7bd83bdbb22f9672050731f12d9a6b216c47659f (diff) | |
download | gnunet-caf3ec1710d8e0964790fb8691a7ea8d51690513.tar.gz gnunet-caf3ec1710d8e0964790fb8691a7ea8d51690513.zip |
Fix gnunet-config check in gnunet-gns-import, don't add records twice
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/gnunet-gns-import.sh | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/contrib/gnunet-gns-import.sh b/contrib/gnunet-gns-import.sh index fd56119d3..21670a3ec 100755 --- a/contrib/gnunet-gns-import.sh +++ b/contrib/gnunet-gns-import.sh | |||
@@ -5,6 +5,11 @@ | |||
5 | LOCATION=$(which gnunet-config) | 5 | LOCATION=$(which gnunet-config) |
6 | if [ -z $LOCATION ] | 6 | if [ -z $LOCATION ] |
7 | then | 7 | then |
8 | LOCATION="gnunet-config" | ||
9 | fi | ||
10 | $LOCATION --version &> /dev/null | ||
11 | if test $? != 0 | ||
12 | then | ||
8 | echo "GNUnet command line tools not found, check environmental variables PATH and GNUNET_PREFIX" | 13 | echo "GNUnet command line tools not found, check environmental variables PATH and GNUNET_PREFIX" |
9 | exit 1 | 14 | exit 1 |
10 | fi | 15 | fi |
@@ -54,11 +59,26 @@ gnunet-identity -e sks-zone -s fs-sks $options | |||
54 | MASTER=`gnunet-identity -d $options | grep master-zone | awk '{print $3}'` | 59 | MASTER=`gnunet-identity -d $options | grep master-zone | awk '{print $3}'` |
55 | SHORT=`gnunet-identity -d $options | grep short-zone | awk '{print $3}'` | 60 | SHORT=`gnunet-identity -d $options | grep short-zone | awk '{print $3}'` |
56 | PRIVATE=`gnunet-identity -d $options | grep private-zone | awk '{print $3}'` | 61 | PRIVATE=`gnunet-identity -d $options | grep private-zone | awk '{print $3}'` |
62 | PIN=72QC35CO20UJN1E91KPJFNT9TG4CLKAPB4VK9S3Q758S9MLBRKOG | ||
57 | 63 | ||
58 | # Link short and private zones into master zone | 64 | # Link short and private zones into master zone |
59 | gnunet-namestore -z master-zone -a -e never -n private -p -t PKEY -V $PRIVATE $options | 65 | if (gnunet-namestore -z master-zone -D -n private -t PKEY | grep "PKEY: $PRIVATE" &>/dev/null) |
60 | gnunet-namestore -z master-zone -a -e never -n short -p -t PKEY -V $SHORT $options | 66 | then |
67 | : | ||
68 | else | ||
69 | gnunet-namestore -z master-zone -a -e never -n private -p -t PKEY -V $PRIVATE $options | ||
70 | fi | ||
71 | if (gnunet-namestore -z master-zone -D -n short -t PKEY | grep "PKEY: $SHORT" &>/dev/null) | ||
72 | then | ||
73 | : | ||
74 | else | ||
75 | gnunet-namestore -z master-zone -a -e never -n short -p -t PKEY -V $SHORT $options | ||
76 | fi | ||
61 | 77 | ||
62 | # Link GNUnet's FCFS zone into master zone under label "pin" | 78 | # Link GNUnet's FCFS zone into master zone under label "pin" |
63 | gnunet-namestore -z master-zone -a -e never -n pin -p -t PKEY -V 72QC35CO20UJN1E91KPJFNT9TG4CLKAPB4VK9S3Q758S9MLBRKOG $options | 79 | if (gnunet-namestore -z master-zone -D -n pin -t PKEY | grep "PKEY: $PIN" &>/dev/null) |
64 | 80 | then | |
81 | : | ||
82 | else | ||
83 | gnunet-namestore -z master-zone -a -e never -n pin -p -t PKEY -V $PIN $options | ||
84 | fi | ||