github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/go/apps/mixnet/scripts/initmixnet.sh (about) 1 #!/bin/bash 2 source ./define.sh 3 4 mkdir -p $DOMAINROOT 5 mkdir -p $DOMAIN 6 7 if [[ -e $DOMAIN ]] 8 then 9 echo "$DOMAIN exists" 10 else 11 mkdir $DOMAIN 12 mkdir $DOMAIN/policy_keys 13 echo "$DOMAIN created" 14 fi 15 16 go install github.com/jlmucb/cloudproxy/go/apps/mixnet... 17 18 cp $GOPATH/bin/mixnet_simpleclient $DOMAINROOT 19 cp $GOPATH/bin/mixnet_simpleserver $DOMAINROOT 20 cp $GOPATH/bin/mixnet_directory $DOMAINROOT 21 cp $GOPATH/bin/mixnet_router $DOMAINROOT 22 cp $GOPATH/bin/mixnet_proxy $DOMAINROOT 23 24 cp $OLD_TEMPLATE $TEMPLATE 25 26 if [[ -e $DOMAIN/linux_tao_host ]] 27 then 28 echo "$DOMAIN/linux_tao_host exists" 29 else 30 mkdir $DOMAIN/linux_tao_host 31 echo "$DOMAIN/linux_tao_host created" 32 fi 33 34 # 35 # For soft tao, we need a key and it must be in the template. 36 # 37 38 KEY_NAME="$($GOPATH/bin/tao domain newsoft -soft_pass $PASSWORD -config_template $TEMPLATE $DOMAIN/linux_tao_host)" 39 echo "host_name: \"$KEY_NAME\"" | tee -a $TEMPLATE 40 41 42 if [[ -e $DOMAIN ]] 43 then 44 echo "$DOMAIN exists" 45 else 46 mkdir $DOMAIN 47 mkdir $DOMAIN/policy_keys 48 echo "$DOMAIN created" 49 fi 50 51 progs=( "mixnet_router" "mixnet_proxy" "mixnet_directory" "mixnet_simpleserver" "mixnet_simpleclient" ) 52 for prog in "${progs[@]}"; 53 do 54 if [[ -e $DOMAIN/$prog ]] 55 then 56 echo "$DOMAIN/$prog exists" 57 rm -f $DOMAIN/$progs/* 58 else 59 mkdir $DOMAIN/$prog 60 echo "$DOMAIN/$prog created" 61 fi 62 done 63 cp $GOPATH/src/github.com/jlmucb/cloudproxy/go/apps/mixnet/*.pem $DOMAIN/mixnet_simpleserver 64 65 $GOPATH/bin/tao domain init -tao_domain $DOMAIN -config_template $TEMPLATE -pub_domain_address "127.0.0.1" -pass $PASSWORD