Statistics
| Branch: | Tag: | Revision:

one / src / image_mad / remotes / fs / rm @ f2c04245

History | View | Annotate | Download (1.85 KB)

1
#!/bin/bash
2

    
3
# -------------------------------------------------------------------------- #
4
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org)             #
5
#                                                                            #
6
# Licensed under the Apache License, Version 2.0 (the "License"); you may    #
7
# not use this file except in compliance with the License. You may obtain    #
8
# a copy of the License at                                                   #
9
#                                                                            #
10
# http://www.apache.org/licenses/LICENSE-2.0                                 #
11
#                                                                            #
12
# Unless required by applicable law or agreed to in writing, software        #
13
# distributed under the License is distributed on an "AS IS" BASIS,          #
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
15
# See the License for the specific language governing permissions and        #
16
# limitations under the License.                                             #
17
#--------------------------------------------------------------------------- #
18

    
19
###############################################################################
20
# This script is used to remove a VM image (SRC) from the image repository 
21
###############################################################################
22

    
23
# ------------ Set up the environment to source common tools ------------ 
24

    
25
if [ -z "${ONE_LOCATION}" ]; then
26
    LIB_LOCATION=/usr/lib/one
27
else
28
    LIB_LOCATION=$ONE_LOCATION/lib
29
fi
30

    
31
. $LIB_LOCATION/sh/scripts_common.sh
32
source $(dirname $0)/fsrc
33

    
34
# ------------ Remove the image to the repository ------------ 
35

    
36
SRC=$1
37

    
38
if [ -e $SRC ] ; then
39
    log "Removing $SRC from the image repository"
40
    exec_and_log "rm $SRC" \
41
        "Error deleting $SRC"
42
fi