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

Feature #1222: Improve readability of the context scripts

This commit is contained in:
Jaime Melis 2012-04-25 11:59:59 +02:00
parent d8d814352e
commit 156d2ea9e0

View File

@ -23,20 +23,12 @@
# - vmid is the id of the VM
# - 0 is the target datastore (system)
i=1
for arg in "$@"; do
if [ $i -eq $# ]; then
DS_ID="$arg"
elif [ $i -eq $(($#-1)) ]; then
VM_ID="$arg"
elif [ $i -eq $(($#-2)) ]; then
DST="$arg"
else
SRC="$SRC $arg"
fi
ARGV=("$@")
let i=i+1
done
DS_ID="${ARGV[$(($#-1))]}"
VM_ID="${ARGV[$(($#-2))]}"
DST="${ARGV[$(($#-3))]}"
SRC="${ARGV[@]:0:$(($#-3))}"
if [ -z "${ONE_LOCATION}" ]; then
TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh