summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2013-12-22 14:31:00 +0000
committerLRN <lrn1986@gmail.com>2013-12-22 14:31:00 +0000
commitcaf3ec1710d8e0964790fb8691a7ea8d51690513 (patch)
treef16e8b969dae6ba836a48123ea75252b974e0c72 /contrib
parent7bd83bdbb22f9672050731f12d9a6b216c47659f (diff)
Fix gnunet-config check in gnunet-gns-import, don't add records twice
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/gnunet-gns-import.sh28
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 @@
LOCATION=$(which gnunet-config)
if [ -z $LOCATION ]
then
+ LOCATION="gnunet-config"
+fi
+$LOCATION --version &> /dev/null
+if test $? != 0
+then
echo "GNUnet command line tools not found, check environmental variables PATH and GNUNET_PREFIX"
exit 1
fi
@@ -54,11 +59,26 @@ gnunet-identity -e sks-zone -s fs-sks $options
MASTER=`gnunet-identity -d $options | grep master-zone | awk '{print $3}'`
SHORT=`gnunet-identity -d $options | grep short-zone | awk '{print $3}'`
PRIVATE=`gnunet-identity -d $options | grep private-zone | awk '{print $3}'`
+PIN=72QC35CO20UJN1E91KPJFNT9TG4CLKAPB4VK9S3Q758S9MLBRKOG
# Link short and private zones into master zone
-gnunet-namestore -z master-zone -a -e never -n private -p -t PKEY -V $PRIVATE $options
-gnunet-namestore -z master-zone -a -e never -n short -p -t PKEY -V $SHORT $options
+if (gnunet-namestore -z master-zone -D -n private -t PKEY | grep "PKEY: $PRIVATE" &>/dev/null)
+then
+ :
+else
+ gnunet-namestore -z master-zone -a -e never -n private -p -t PKEY -V $PRIVATE $options
+fi
+if (gnunet-namestore -z master-zone -D -n short -t PKEY | grep "PKEY: $SHORT" &>/dev/null)
+then
+ :
+else
+ gnunet-namestore -z master-zone -a -e never -n short -p -t PKEY -V $SHORT $options
+fi
# Link GNUnet's FCFS zone into master zone under label "pin"
-gnunet-namestore -z master-zone -a -e never -n pin -p -t PKEY -V 72QC35CO20UJN1E91KPJFNT9TG4CLKAPB4VK9S3Q758S9MLBRKOG $options
-
+if (gnunet-namestore -z master-zone -D -n pin -t PKEY | grep "PKEY: $PIN" &>/dev/null)
+then
+ :
+else
+ gnunet-namestore -z master-zone -a -e never -n pin -p -t PKEY -V $PIN $options
+fi