~scarneiro/ubuntu/oneiric/opendrim-lmp-recordlog/fix-for-756108

« back to all changes in this revision

Viewing changes to registration/OpenDRIM_RecordLogConformsToProfile-remove.sh

  • Committer: Bazaar Package Importer
  • Author(s): Guillaume BOTTEX
  • Date: 2009-08-19 17:08:36 UTC
  • Revision ID: james.westby@ubuntu.com-20090819170836-4pdxix40ulw5xqds
Tags: upstream-1.1.1
ImportĀ upstreamĀ versionĀ 1.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
################################################################################
 
4
# Linux Management Providers (LMP), OpenDRIM_RecordLogPackage provider package
 
5
# Copyright (C) 2007 Ilsoo Byun, ETRI <widepis@etri.re.kr, widepis@empal.com>
 
6
 
7
# This program is being developed under the "OpenDRIM" project.
 
8
# The "OpenDRIM" project web page: http://opendrim.sourceforge.net
 
9
# The "OpenDRIM" project mailing list: opendrim@googlegroups.com
 
10
 
11
# This program is free software; you can redistribute it and/or
 
12
# modify it under the terms of the GNU General Public License
 
13
# as published by the Free Software Foundation; version 2
 
14
# of the License.
 
15
 
16
# This program is distributed in the hope that it will be useful,
 
17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
# GNU General Public License for more details.
 
20
 
21
# You should have received a copy of the GNU General Public License
 
22
# along with this program; if not, write to the Free Software
 
23
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
24
#################################################################################
 
25
 
 
26
#################################################################################
 
27
# To contributors, please leave your contact information in this section
 
28
# AND comment your changes in the source code.
 
29
 
30
# Modified by 2008 Guillaume BOTTEX, ETRI <guillaumebottex@etri.re.kr, guillaumebottex@gmail.com>
 
31
################################################################################
 
32
 
 
33
if test "$2" = pegasus
 
34
then
 
35
        
 
36
        cimprovider -d -m OpenDRIM_RecordLogPackage_OpenDRIM_RecordLogConformsToProfileModule
 
37
        cimprovider -r -m OpenDRIM_RecordLogPackage_OpenDRIM_RecordLogConformsToProfileModule
 
38
        
 
39
        OUTFILE=./TEMP_REGISTRATION
 
40
        
 
41
cat >> $OUTFILE <<EOFC
 
42
<?xml version="1.0" encoding="utf-8" ?>
 
43
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
 
44
 <MESSAGE ID="1" PROTOCOLVERSION="1.0">
 
45
  <SIMPLEREQ>
 
46
   <IMETHODCALL NAME="DeleteClass">
 
47
    <LOCALNAMESPACEPATH>
 
48
EOFC
 
49
        
 
50
        namespace=$1
 
51
        index=`expr index $namespace /`
 
52
        
 
53
        while [ $index != 0 ]
 
54
        do
 
55
          namespaceFragment=${namespace:0:index-1}
 
56
          namespace=${namespace:index:${#namespace}-index}
 
57
          index=`expr index $namespace /`
 
58
cat >> $OUTFILE <<EOFC
 
59
     <NAMESPACE NAME="$namespaceFragment"></NAMESPACE>
 
60
EOFC
 
61
        done
 
62
        
 
63
cat >> $OUTFILE <<EOFC
 
64
     <NAMESPACE NAME="$namespace"></NAMESPACE>
 
65
EOFC
 
66
        
 
67
cat >> $OUTFILE <<EOFC
 
68
    </LOCALNAMESPACEPATH>
 
69
    <IPARAMVALUE NAME="ClassName">
 
70
     <CLASSNAME NAME="OpenDRIM_RecordLogConformsToProfile"/>
 
71
    </IPARAMVALUE>
 
72
   </IMETHODCALL>
 
73
  </SIMPLEREQ>
 
74
 </MESSAGE>
 
75
</CIM>
 
76
 
 
77
EOFC
 
78
        
 
79
        PATH=$PATH:$PEGASUS_HOME/bin
 
80
        wbemexec $OUTFILE
 
81
        
 
82
        rm -f $OUTFILE
 
83
cat >> $OUTFILE <<EOFC
 
84
<?xml version="1.0" encoding="utf-8" ?>
 
85
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
 
86
 <MESSAGE ID="1" PROTOCOLVERSION="1.0">
 
87
  <SIMPLEREQ>
 
88
   <IMETHODCALL NAME="DeleteClass">
 
89
    <LOCALNAMESPACEPATH>
 
90
EOFC
 
91
        
 
92
        namespace=$3
 
93
        index=`expr index $namespace /`
 
94
        
 
95
        while [ $index != 0 ]
 
96
        do
 
97
          namespaceFragment=${namespace:0:index-1}
 
98
          namespace=${namespace:index:${#namespace}-index}
 
99
          index=`expr index $namespace /`
 
100
cat >> $OUTFILE <<EOFC
 
101
     <NAMESPACE NAME="$namespaceFragment"></NAMESPACE>
 
102
EOFC
 
103
        done
 
104
        
 
105
cat >> $OUTFILE <<EOFC
 
106
     <NAMESPACE NAME="$namespace"></NAMESPACE>
 
107
EOFC
 
108
        
 
109
cat >> $OUTFILE <<EOFC
 
110
    </LOCALNAMESPACEPATH>
 
111
    <IPARAMVALUE NAME="ClassName">
 
112
     <CLASSNAME NAME="OpenDRIM_RecordLogConformsToProfile"/>
 
113
    </IPARAMVALUE>
 
114
   </IMETHODCALL>
 
115
  </SIMPLEREQ>
 
116
 </MESSAGE>
 
117
</CIM>
 
118
 
 
119
EOFC
 
120
        
 
121
        wbemexec $OUTFILE
 
122
        
 
123
        rm -f $OUTFILE
 
124
 
 
125
fi
 
126
 
 
127
if test "$2" = sfcb
 
128
then
 
129
        
 
130
        OUTFILE=./OpenDRIM_RecordLogConformsToProfile.reg
 
131
        
 
132
cat >> $OUTFILE <<EOFC
 
133
[OpenDRIM_RecordLogConformsToProfile]   
 
134
   provider: OpenDRIM_RecordLogPackage_OpenDRIM_RecordLogConformsToProfileProvider
 
135
   location: cmpiOpenDRIM_RecordLogPackage_OpenDRIM_RecordLogConformsToProfileProvider
 
136
   type: instance association
 
137
   namespace: $1 $3
 
138
#
 
139
EOFC
 
140
        
 
141
        sfcbunstage -r $OUTFILE -n $1 OpenDRIM_RecordLogConformsToProfile.mof
 
142
        sfcbunstage -r $OUTFILE -n $3 OpenDRIM_RecordLogConformsToProfile.mof
 
143
        
 
144
        rm -f $OUTFILE
 
145
 
 
146
        sfcbrepos -f
 
147
 
 
148
fi
 
149
 
 
150
if test "$2" = openwbem
 
151
then
 
152
        
 
153
        OUTFILE=./OpenDRIM_RecordLogConformsToProfile-reg.mof
 
154
        rm -f $OUTFILE
 
155
        sed "s/Provider *( *\"cmpi:/Provider(\"cmpi::/g" < $4/mof/OpenDRIM_RecordLogConformsToProfile.mof >> $OUTFILE
 
156
        owmofc -u http://localhost/$1 -r $OUTFILE
 
157
        owmofc -u http://localhost/$3 -r $OUTFILE
 
158
 
 
159
        rm -f $OUTFILE
 
160
        
 
161
fi