~openattestation-ubuntu/ubuntu/precise/openattestation/trunk

« back to all changes in this revision

Viewing changes to CommandTool/oat_view_os

  • Committer: James Page
  • Author(s): James Page
  • Date: 2012-10-17 09:49:27 UTC
  • mfrom: (0.2.1) (1.1.1)
  • Revision ID: james.page@canonical.com-20121017094927-qqwus64kqtgprzwg
Tags: 1.5~rc1-0ubuntu1~ppa1
New upstream release candidate. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#OS view
 
3
PARM="-h"
 
4
PORT="8443"
 
5
ShowOSViewExample()
 
6
{
 
7
   echo -e "OS view example:\n\033[31;49;5;1m bash oat_view_os -h HOSTNAME_OF_OAT-APPRAISER\033[0m"
 
8
}
 
9
 
 
10
if [ $# -lt 2 ];then
 
11
  echo "parm num error!"
 
12
  ShowOSViewExample
 
13
  exit 0
 
14
fi
 
15
if [ $1 != $PARM ];then
 
16
  echo "parm error!"
 
17
  ShowOSViewExample
 
18
  exit 0
 
19
fi
 
20
 
 
21
HOST_NAME="$2"
 
22
view_os()
 
23
{
 
24
     curl --cacert ./certfile.cer -H "Content-Type: application/json" \
 
25
     -X GET https://$HOST_NAME:$PORT/WLMService/resources/os -ssl3
 
26
}
 
27
 
 
28
view_os
 
29
echo -e "\n"