#!/bin/bash # Copyright (C) 2012 GRNET S.A. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. set -e . common.sh check_required() { local required_params="IMG_ID IMG_FORMAT" local osparams="$required_params IMG_PASSWD IMG_PROPERTIES IMG_PERSONALITY CONFIG_URL" local osp source_variant # Store OSP_VAR in VAR for param in $osparams; do # Only do the evaluation if OSP_$param is defined osp="OSP_$param" if [ -n "${!osp+dummy}" ]; then eval $param=\"\$$osp\" fi done for var in $required_params; do if [ -z "${!var}" ]; then log_error "Missing OS API Parameter: ${var}" exit 1 fi done } if [ -z "$OSP_CONFIG_URL" ]; then check_required fi exit 0 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :