diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-10 23:23:12 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-10 23:23:12 +0000 |
commit | c9c2a2e547a50357ef1db49e0de9fb8d5b07c231 (patch) | |
tree | 496d548b862cd92e8410847ed447f7627ef65365 /contrib/gnunet-gns-import.sh | |
parent | 472e134ca8d527c92535a5221b69faea6af00579 (diff) | |
download | gnunet-c9c2a2e547a50357ef1db49e0de9fb8d5b07c231.tar.gz gnunet-c9c2a2e547a50357ef1db49e0de9fb8d5b07c231.zip |
-anonymous contribution: patch to add -c support to gnunet-gns-import.sh
Diffstat (limited to 'contrib/gnunet-gns-import.sh')
-rwxr-xr-x | contrib/gnunet-gns-import.sh | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/contrib/gnunet-gns-import.sh b/contrib/gnunet-gns-import.sh index 21156bc52..dacdf7887 100755 --- a/contrib/gnunet-gns-import.sh +++ b/contrib/gnunet-gns-import.sh | |||
@@ -1,30 +1,48 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # This shell-script will import some GNS authorities into your GNS | 2 | # This shell-script will import some GNS authorities into your GNS |
3 | # namestore. | 3 | # namestore. |
4 | # | 4 | |
5 | options='' | ||
6 | |||
7 | while getopts "c:" opt; do | ||
8 | case $opt in | ||
9 | c) | ||
10 | options+="-c $OPTARG" | ||
11 | ;; | ||
12 | \?) | ||
13 | echo "Invalid option: -$OPTARG" >&2 | ||
14 | exit 1 | ||
15 | ;; | ||
16 | :) | ||
17 | echo "Option -$OPTARG requires an argument." >&2 | ||
18 | exit 1 | ||
19 | ;; | ||
20 | esac | ||
21 | done | ||
22 | |||
5 | # By default, we create three GNS zones: | 23 | # By default, we create three GNS zones: |
6 | gnunet-identity -C master-zone | 24 | gnunet-identity -C master-zone $options |
7 | gnunet-identity -C short-zone | 25 | gnunet-identity -C short-zone $options |
8 | gnunet-identity -C private-zone | 26 | gnunet-identity -C private-zone $options |
9 | 27 | ||
10 | # Additionally, we create the FS SKS zone | 28 | # Additionally, we create the FS SKS zone |
11 | gnunet-identity -C sks-zone | 29 | gnunet-identity -C sks-zone $options |
12 | 30 | ||
13 | # Integrate those with the respective subsystems. | 31 | # Integrate those with the respective subsystems. |
14 | gnunet-identity -e short-zone -s gns-short | 32 | gnunet-identity -e short-zone -s gns-short $options |
15 | gnunet-identity -e master-zone -s gns-master | 33 | gnunet-identity -e master-zone -s gns-master $options |
16 | gnunet-identity -e private-zone -s gns-private | 34 | gnunet-identity -e private-zone -s gns-private $options |
17 | gnunet-identity -e sks-zone -s fs-sks | 35 | gnunet-identity -e sks-zone -s fs-sks $options |
18 | 36 | ||
19 | # Get the public keys as strings (so we can create PKEY records) | 37 | # Get the public keys as strings (so we can create PKEY records) |
20 | MASTER=`gnunet-identity -d | grep master-zone | awk '{print $3}'` | 38 | MASTER=`gnunet-identity -d $options | grep master-zone | awk '{print $3}'` |
21 | SHORT=`gnunet-identity -d | grep short-zone | awk '{print $3}'` | 39 | SHORT=`gnunet-identity -d $options | grep short-zone | awk '{print $3}'` |
22 | PRIVATE=`gnunet-identity -d | grep private-zone | awk '{print $3}'` | 40 | PRIVATE=`gnunet-identity -d $options | grep private-zone | awk '{print $3}'` |
23 | 41 | ||
24 | # Link short and private zones into master zone | 42 | # Link short and private zones into master zone |
25 | gnunet-namestore -z master-zone -a -e never -n private -p -t PKEY -V $PRIVATE | 43 | gnunet-namestore -z master-zone -a -e never -n private -p -t PKEY -V $PRIVATE $options |
26 | gnunet-namestore -z master-zone -a -e never -n short -p -t PKEY -V $SHORT | 44 | gnunet-namestore -z master-zone -a -e never -n short -p -t PKEY -V $SHORT $options |
27 | 45 | ||
28 | # Link GNUnet's FCFS zone into master zone under label "pin" | 46 | # Link GNUnet's FCFS zone into master zone under label "pin" |
29 | gnunet-namestore -z master-zone -a -e never -n pin -p -t PKEY -V 72QC35CO20UJN1E91KPJFNT9TG4CLKAPB4VK9S3Q758S9MLBRKOG | 47 | gnunet-namestore -z master-zone -a -e never -n pin -p -t PKEY -V 72QC35CO20UJN1E91KPJFNT9TG4CLKAPB4VK9S3Q758S9MLBRKOG $options |
30 | 48 | ||