~ubuntu-branches/ubuntu/trusty/opendrim-lmp-ssh/trusty

« back to all changes in this revision

Viewing changes to registration/OpenDRIM_HostedSSHService-remove.sh

  • Committer: Bazaar Package Importer
  • Author(s): Guillaume BOTTEX
  • Date: 2010-07-07 11:04:10 UTC
  • Revision ID: james.westby@ubuntu.com-20100707110410-2bojrtqjp582wiy8
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), SSH provider package
 
5
# Copyright (C) 2010 Feng Zhanlei, REDFLAG <fengzhanlei@redflag-linux.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 Guillaume BOTTEX <guillaumebottex@uxsystem.net>, UXSystem, 2010
 
31
#################################################################################
 
32
 
 
33
if test "$2" = pegasus
 
34
then
 
35
        
 
36
        cimprovider -d -m SSH_OpenDRIM_HostedSSHServiceModule
 
37
        cimprovider -r -m SSH_OpenDRIM_HostedSSHServiceModule
 
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_HostedSSHService"/>
 
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
 
 
84
fi
 
85
 
 
86
if test "$2" = sfcb
 
87
then
 
88
        
 
89
        OUTFILE=./OpenDRIM_HostedSSHService.reg
 
90
        
 
91
cat >> $OUTFILE <<EOFC
 
92
[OpenDRIM_HostedSSHService]   
 
93
   provider: SSH_OpenDRIM_HostedSSHServiceProvider
 
94
   location: cmpiSSH_OpenDRIM_HostedSSHServiceProvider
 
95
   type: instance association
 
96
   namespace: $1
 
97
#
 
98
EOFC
 
99
        
 
100
        sfcbunstage -r $OUTFILE -n $1 OpenDRIM_HostedSSHService.mof
 
101
        
 
102
        rm -f $OUTFILE
 
103
        
 
104
        sfcbrepos -f
 
105
        
 
106
fi
 
107
 
 
108
if test "$2" = openwbem
 
109
then
 
110
        
 
111
        OUTFILE=./OpenDRIM_HostedSSHService-reg.mof
 
112
        rm -f $OUTFILE
 
113
        sed "s/Provider *( *\"cmpi:/Provider(\"cmpi::/g" < $4/mof/OpenDRIM_HostedSSHService.mof >> $OUTFILE
 
114
        owmofc -u http://localhost/$1 -r $OUTFILE
 
115
 
 
116
        rm -f $OUTFILE
 
117
        
 
118
fi