~ubuntu-branches/ubuntu/saucy/opendrim-lmp-simpleidentitymanagement/saucy

« back to all changes in this revision

Viewing changes to registration/OpenDRIM_AccountAssignedIdentity-remove.sh

  • Committer: Bazaar Package Importer
  • Author(s): Guillaume BOTTEX
  • Date: 2010-06-21 15:54:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100621155400-myesv5hd2f3s8x9y
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
#################################################################################
 
4
# Linux Management Providers (LMP), Simple Identity Management provider package
 
5
# Copyright (C) 2007 Frederic Desmons, ETRI <desmons@etri.re.kr, desmons_frederic@yahoo.fr>
 
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 2009 Khahramon NURIDDINOV, TUIT <qahramon0786@gmail.com>
 
31
# Modified by 2009 Guillaume BOTTEX, ETRI <guillaumebottex@etri.re.kr>
 
32
#################################################################################
 
33
 
 
34
if test "$2" = pegasus
 
35
then
 
36
        
 
37
        cimprovider -d -m Simple_Identity_Management_OpenDRIM_AccountAssignedIdentityModule
 
38
        cimprovider -r -m Simple_Identity_Management_OpenDRIM_AccountAssignedIdentityModule
 
39
        
 
40
        OUTFILE=./TEMP_REGISTRATION
 
41
        
 
42
cat >> $OUTFILE <<EOFC
 
43
<?xml version="1.0" encoding="utf-8" ?>
 
44
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
 
45
 <MESSAGE ID="1" PROTOCOLVERSION="1.0">
 
46
  <SIMPLEREQ>
 
47
   <IMETHODCALL NAME="DeleteClass">
 
48
    <LOCALNAMESPACEPATH>
 
49
EOFC
 
50
        
 
51
        namespace=$1
 
52
        index=`expr index $namespace /`
 
53
        
 
54
        while [ $index != 0 ]
 
55
        do
 
56
          namespaceFragment=${namespace:0:index-1}
 
57
          namespace=${namespace:index:${#namespace}-index}
 
58
          index=`expr index $namespace /`
 
59
cat >> $OUTFILE <<EOFC
 
60
     <NAMESPACE NAME="$namespaceFragment"></NAMESPACE>
 
61
EOFC
 
62
        done
 
63
        
 
64
cat >> $OUTFILE <<EOFC
 
65
     <NAMESPACE NAME="$namespace"></NAMESPACE>
 
66
EOFC
 
67
        
 
68
cat >> $OUTFILE <<EOFC
 
69
    </LOCALNAMESPACEPATH>
 
70
    <IPARAMVALUE NAME="ClassName">
 
71
     <CLASSNAME NAME="OpenDRIM_AccountAssignedIdentity"/>
 
72
    </IPARAMVALUE>
 
73
   </IMETHODCALL>
 
74
  </SIMPLEREQ>
 
75
 </MESSAGE>
 
76
</CIM>
 
77
 
 
78
EOFC
 
79
        
 
80
        PATH=$PATH:$PEGASUS_HOME/bin
 
81
        wbemexec $OUTFILE
 
82
        
 
83
        rm -f $OUTFILE
 
84
 
 
85
fi
 
86
 
 
87
if test "$2" = sfcb
 
88
then
 
89
        
 
90
        OUTFILE=./OpenDRIM_AccountAssignedIdentity.reg
 
91
        
 
92
cat >> $OUTFILE <<EOFC
 
93
[OpenDRIM_AccountAssignedIdentity]   
 
94
   provider: Simple_Identity_Management_OpenDRIM_AccountAssignedIdentityProvider
 
95
   location: cmpiSimple_Identity_Management_OpenDRIM_AccountAssignedIdentityProvider
 
96
   type: instance association
 
97
   namespace: $1
 
98
#
 
99
EOFC
 
100
        
 
101
        sfcbunstage -r $OUTFILE -n $1 OpenDRIM_AccountAssignedIdentity.mof
 
102
        
 
103
        rm -f $OUTFILE
 
104
        
 
105
        sfcbrepos -f
 
106
        
 
107
fi
 
108
 
 
109
if test "$2" = openwbem
 
110
then
 
111
        
 
112
        OUTFILE=./OpenDRIM_AccountAssignedIdentity-reg.mof
 
113
        rm -f $OUTFILE
 
114
        sed "s/Provider *( *\"cmpi:/Provider(\"cmpi::/g" < $4/mof/OpenDRIM_AccountAssignedIdentity.mof >> $OUTFILE
 
115
        owmofc -u http://localhost/$1 -r $OUTFILE
 
116
 
 
117
        rm -f $OUTFILE
 
118
        
 
119
fi