Guest User

provisioner.sh

a guest
Nov 13th, 2013
14
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. source oat_function
  3. LOG_DIR=/var/log/oat-client
  4. CLIENT_DIR=/usr/share/oat-client
  5. SYSD=/etc/systemd/system
  6.  
  7. [[ ! -e $SYSD/oat-client.service ]] && systemctl enable oat-client.service
  8.  
  9. linkJar "/usr/share/oat-client/lib"
  10.  
  11. if [ ! -e /etc/oat-client/OATprovisioner.properties -o ! \
  12.        -e /etc/oat-client/OAT.properties ];then
  13.     if [ $# -lt 1 ];then
  14.       bash OAT_client.sh
  15.     else
  16.       [[ -e /etc/oat-client/OAT.properties ]] && \
  17.             rm -f /etc/oat-client/OAT.properties
  18.       [[ -e /etc/oat-client/OATprovisioner.properties ]] && \
  19.             rm -f /etc/oat-client/OATprovisioner.properties
  20.       bash OAT_client.sh "$1"
  21.     fi
  22. fi
  23.  
  24. /usr/bin/NIARL_TPM_Module -mode 14 -owner_auth 3031323334353637383930313233343536373839 -cred_type EC
  25.  
  26. (
  27. cd $CLIENT_DIR
  28. export provclasspath=".:./lib/activation.jar:./lib/axis.jar:./lib/bcprov-jdk15-141.jar:./lib/commons-discovery-0.2.jar:./lib/commons-logging-1.0.4.jar:./lib/FastInfoset.jar:./lib/HisPrivacyCAWebServices-client.jar:./lib/HisPrivacyCAWebServices2-client.jar:./lib/HisWebServices-client.jar:./lib/http.jar:./lib/jaxb-api.jar:./lib/jaxb-impl.jar:./lib/jaxb-xjc.jar:./lib/jaxrpc.jar:./lib/jaxws-api.jar:./lib/jaxws-rt.jar:./lib/jaxws-tools.jar:./lib/jsr173_api.jar:./lib/jsr181-api.jar:./lib/jsr250-api.jar:./lib/mail.jar:./lib/mimepull.jar:./lib/PrivacyCA.jar:./lib/resolver.jar:./lib/saaj-api.jar:./lib/saaj-impl.jar:./lib/SALlib_hibernate3.jar:./lib/stax-ex.jar:./lib/xmlstreambuffer.jar:./lib/TSSCoreService.jar:./lib/woodstox.jar:./lib/wsdl4j-1.5.1.jar:./lib/istack-commons-runtime.jar:./lib/txw2.jar:./lib/xml-resolver.jar:./lib/glassfish-gmbal.jar:./lib/glassfish-policy.jar:./lib/glassfish-pfl-tf.jar:./lib/glassfish-pfl-basic.jar:./lib/glassfish-management-api.jar:./lib/glassfish-ha-api.jar"
  29.  
  30. java -cp $provclasspath gov.niarl.his.privacyca.HisTpmProvisioner
  31. ret=$?
  32. if [ $ret == 0 ] ; then
  33.     echo "Successfully initialized TPM"
  34. else
  35.     echo "Failed to initialize the TPM, error $ret"
  36. fi
  37.  
  38. java -cp $provclasspath gov.niarl.his.privacyca.HisIdentityProvisioner
  39. ret=$?
  40. if [ $ret == 0 ]; then
  41.     echo "Successfully received AIC from Privacy CA"
  42. else
  43.     echo "Failed to receive AIC from Privacy CA, error $ret"
  44. fi
  45.  
  46. java -cp $provclasspath gov.niarl.his.privacyca.HisRegisterIdentity
  47. ret=$?
  48. if [ $ret == 0 ]; then
  49.     echo "Successfully registered identity with appraiser"
  50. else
  51.     echo "Failed to register identity with appraiser, error $ret"
  52. fi
  53. )
RAW Paste Data