Advertisement
Guest User

OAT_client.sh

a guest
Nov 13th, 2013
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.09 KB | None | 0 0
  1. #!/bin/bash
  2. TMP="./appraiser.hostnameOoooooOOO"
  3. cat /dev/null > $TMP
  4. appraiser_hostname()
  5. {
  6.    dialog  --no-cancel --no-ok --title "OpenAttestation" \
  7.         --backtitle "OpenAttestation client installation" \
  8.         --inputbox "Input OAT appraiser hostname:" 16 51 "" 2>$TMP
  9.    clear
  10. }
  11.  
  12. if [ $# -lt 1 ];then
  13.   appraiser_hostname
  14. else
  15.   echo "$1" > $TMP
  16. fi
  17.  
  18. if [ ! -s $TMP ];then
  19.   appraiser_hostname_str="APPRAISER_HOSTNAME"
  20. else
  21.   appraiser_hostname_str="`cat $TMP`"
  22. fi
  23.  
  24. #OAT.properties
  25. OATProperties()
  26. {
  27.    echo "WebServiceUrl=https://$appraiser_hostname_str:8443/HisWebServices"
  28.    echo "KeyAuth=1111111111111111111111111111111111111111"
  29.    echo "KeyIndex=1"
  30.    echo "TpmQuoteExecutableName=NIARL_TPM_Module"
  31.    echo "SplashImage=OAT07.jpg"
  32.    echo "TrustStore=/usr/share/oat-client/TrustStore.jks"
  33. }
  34.  
  35. OATProperties > /etc/oat-client/OAT.properties
  36. if [ ! -s $TMP ];then
  37.   echo "oat client attestation config   ...FAILD"
  38. else
  39.   echo "oat client attestation config   ...ok"
  40. fi
  41.  
  42. #OATprovisioner.properties
  43. OATprovisionerProperties()
  44. {
  45.    echo "EcValidityDays = 3652"
  46.    echo "TpmOwnerAuth = 3031323334353637383930313233343536373839"
  47.    echo "HisIdentityLabel = HIS Identity Key"
  48.    echo "HisIdentityIndex = 1"
  49.    echo "HisIdentityAuth = 1111111111111111111111111111111111111111"
  50.    echo "PrivacyCaCertFile = PrivacyCA.cer"
  51.    echo "PrivacyCaUrl = https://$appraiser_hostname_str:8443/HisPrivacyCAWebServices2"
  52.    echo "HisRegistrationUrl = https://$appraiser_hostname_str:8443/HisWebServices"
  53.    echo "TrustStore = TrustStore.jks"
  54.    echo "NtruBypass = true"
  55.    echo "ClientPath = /usr/share/oat-client"
  56.    echo "ecStorage = NVRAM"
  57.    echo "ecSigningKeySize = 2048"
  58. }
  59.  
  60. OATprovisionerProperties  > /etc/oat-client/OATprovisioner.properties
  61. if [ ! -s $TMP ];then
  62.    echo "oat client provisioner config   ...FAILD"
  63.    echo "oat client installation  ...FAILD"
  64.     echo "oat appraiser hostname is NULL"
  65. else
  66.    echo "oat client provisioner config   ...ok"
  67.    echo "oat client installation  ...ok"
  68.    echo "oat appraiser hostname: $appraiser_hostname_str"
  69. fi
  70.  
  71. rm -rf $TMP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement