2 # This shell-script will import some GNS authorities into your GNS
5 LOCATION=$(which gnunet-config)
8 echo "GNUnet command line tools not found, check environmental variables PATH and GNUNET_PREFIX"
12 gnunet-arm -I 1> /dev/null 2>/dev/null
15 echo "GNUnet is not running, please start GNUnet before running import"
21 while getopts "c:" opt; do
27 echo "Invalid option: -$OPTARG" >&2
31 echo "Option -$OPTARG requires an argument." >&2
37 # By default, we create three GNS zones:
38 gnunet-identity -C master-zone $options
39 gnunet-identity -C short-zone $options
40 gnunet-identity -C private-zone $options
42 # Additionally, we create the FS SKS zone
43 gnunet-identity -C sks-zone $options
45 # Integrate those with the respective subsystems.
46 gnunet-identity -e short-zone -s gns-short $options
47 gnunet-identity -e master-zone -s gns-master $options
48 gnunet-identity -e master-zone -s namestore $options
49 gnunet-identity -e master-zone -s gns-proxy $options
50 gnunet-identity -e private-zone -s gns-private $options
51 gnunet-identity -e sks-zone -s fs-sks $options
53 # Get the public keys as strings (so we can create PKEY records)
54 MASTER=`gnunet-identity -d $options | grep master-zone | awk '{print $3}'`
55 SHORT=`gnunet-identity -d $options | grep short-zone | awk '{print $3}'`
56 PRIVATE=`gnunet-identity -d $options | grep private-zone | awk '{print $3}'`
58 # 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
60 gnunet-namestore -z master-zone -a -e never -n short -p -t PKEY -V $SHORT $options
62 # 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