1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

feature #1112: Move SED initialization to scripts_common.sh. Always fix path for SRC/DST

This commit is contained in:
Ruben S. Montero 2012-03-06 22:25:39 +01:00
parent fb44e1955a
commit e4017e6106
2 changed files with 8 additions and 7 deletions

View File

@ -38,6 +38,12 @@ SUDO=sudo
WGET=wget
GREP=grep
if [ "x$(uname -s)" = "xLinux" ]; then
SED="$SED -r"
else
SED="/usr/bin/sed -E"
fi
# Used for log messages
SCRIPT_NAME=`basename $0`

View File

@ -33,12 +33,6 @@ ONE_SH=$ONE_LIB/sh
. $ONE_SH/scripts_common.sh
if [ "x$(uname -s)" = "xLinux" ]; then
SED="$SED -r"
else
SED="/usr/bin/sed -E"
fi
# ------------------------------------------------------------------------------
# Function to get hosts and paths from arguments
# ------------------------------------------------------------------------------
@ -52,7 +46,8 @@ function arg_host
# Gets the path from an argument
function arg_path
{
echo $1 | $SED 's/^[^:]*:(.*)$/\1/'
ARG_PATH=`echo $1 | $SED 's/^[^:]*:(.*)$/\1/'`
fix_dir_slashes "$ARG_PATH"
}
#Return the DATASTORE_LOCATION from OpenNebula configuration