~ubuntu-branches/ubuntu/raring/opendrim-lmp-systemmemory/raring

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/bin/bash

################################################################################
# Linux Management Providers (LMP), System Memory provider package
# Copyright (C) 2008 Guillaume BOTTEX, ETRI <guillaumebottex@etri.re.kr, guillaumebottex@gmail.com>
# 
# This program is being developed under the "OpenDRIM" project.
# The "OpenDRIM" project web page: http://opendrim.sourceforge.net
# The "OpenDRIM" project mailing list: opendrim@googlegroups.com
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2
# of the License.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#################################################################################

#################################################################################
# To contributors, please leave your contact information in this section
# AND comment your changes in the source code.
# 
# Modified by <Author(s)>, <Affiliation>, <Year>
################################################################################

if test "$2" = pegasus
then
	
	cimprovider -d -m SystemMemory_OpenDRIM_MemoryConformsToProfileModule
	cimprovider -r -m SystemMemory_OpenDRIM_MemoryConformsToProfileModule
	
	OUTFILE=./TEMP_REGISTRATION
	
cat >> $OUTFILE <<EOFC
<?xml version="1.0" encoding="utf-8" ?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
 <MESSAGE ID="1" PROTOCOLVERSION="1.0">
  <SIMPLEREQ>
   <IMETHODCALL NAME="DeleteClass">
    <LOCALNAMESPACEPATH>
EOFC
	
	namespace=$1
	index=`expr index $namespace /`
	
	while [ $index != 0 ]
	do
	  namespaceFragment=${namespace:0:index-1}
	  namespace=${namespace:index:${#namespace}-index}
	  index=`expr index $namespace /`
cat >> $OUTFILE <<EOFC
     <NAMESPACE NAME="$namespaceFragment"></NAMESPACE>
EOFC
	done
	
cat >> $OUTFILE <<EOFC
     <NAMESPACE NAME="$namespace"></NAMESPACE>
EOFC
	
cat >> $OUTFILE <<EOFC
    </LOCALNAMESPACEPATH>
    <IPARAMVALUE NAME="ClassName">
     <CLASSNAME NAME="OpenDRIM_MemoryConformsToProfile"/>
    </IPARAMVALUE>
   </IMETHODCALL>
  </SIMPLEREQ>
 </MESSAGE>
</CIM>

EOFC
	
	PATH=$PATH:$PEGASUS_HOME/bin
	wbemexec $OUTFILE
	
	rm -f $OUTFILE
cat >> $OUTFILE <<EOFC
<?xml version="1.0" encoding="utf-8" ?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
 <MESSAGE ID="1" PROTOCOLVERSION="1.0">
  <SIMPLEREQ>
   <IMETHODCALL NAME="DeleteClass">
    <LOCALNAMESPACEPATH>
EOFC
	
	namespace=$3
	index=`expr index $namespace /`
	
	while [ $index != 0 ]
	do
	  namespaceFragment=${namespace:0:index-1}
	  namespace=${namespace:index:${#namespace}-index}
	  index=`expr index $namespace /`
cat >> $OUTFILE <<EOFC
     <NAMESPACE NAME="$namespaceFragment"></NAMESPACE>
EOFC
	done
	
cat >> $OUTFILE <<EOFC
     <NAMESPACE NAME="$namespace"></NAMESPACE>
EOFC
	
cat >> $OUTFILE <<EOFC
    </LOCALNAMESPACEPATH>
    <IPARAMVALUE NAME="ClassName">
     <CLASSNAME NAME="OpenDRIM_MemoryConformsToProfile"/>
    </IPARAMVALUE>
   </IMETHODCALL>
  </SIMPLEREQ>
 </MESSAGE>
</CIM>

EOFC
	
	wbemexec $OUTFILE
	
	rm -f $OUTFILE

fi

if test "$2" = sfcb
then
	
	OUTFILE=./OpenDRIM_MemoryConformsToProfile.reg
	
cat >> $OUTFILE <<EOFC
[OpenDRIM_MemoryConformsToProfile]   
   provider: SystemMemory_OpenDRIM_MemoryConformsToProfileProvider
   location: cmpiSystemMemory_OpenDRIM_MemoryConformsToProfileProvider
   type: instance association
   namespace: $1 $3
#
EOFC
	
	sfcbunstage -r $OUTFILE -n $1 OpenDRIM_MemoryConformsToProfile.mof
	sfcbunstage -r $OUTFILE -n $3 OpenDRIM_MemoryConformsToProfile.mof
	
	rm -f $OUTFILE

	sfcbrepos -f

fi

if test "$2" = openwbem
then
	
	OUTFILE=./OpenDRIM_MemoryConformsToProfile-reg.mof
	rm -f $OUTFILE
	sed "s/Provider *( *\"cmpi:/Provider(\"cmpi::/g" < $4/mof/OpenDRIM_MemoryConformsToProfile.mof >> $OUTFILE
	owmofc -u http://localhost/$1 -r $OUTFILE
	owmofc -u http://localhost/$3 -r $OUTFILE

	rm -f $OUTFILE
	
fi