emulators/sbemu/multinet/build.sh
#!/bin/bash # Copyright (c) 2015 Intracom S.A. Telecom Solutions. All rights reserved.## This program and the accompanying materials are made available under the# terms of the Eclipse Public License v1.0 which accompanies this distribution,# and is available at http://www.eclipse.org/legal/epl-v10.html SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)Double quote to prevent globbing and word splitting.echo $SCRIPT_DIR MULTINET_LOCATION="https://github.com/intracom-telecom-sdn/multinet.git" Double quote to prevent globbing and word splitting.if [ ! -d $SCRIPT_DIR"/multinet" ]; thenDouble quote to prevent globbing and word splitting. git clone -b v.1.0 $MULTINET_LOCATION $SCRIPT_DIR"/multinet"Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. if [ $? -ne 0 ]; then echo "[build.sh] Cloning multinet failed. Exiting ..." exit 1 fiDouble quote to prevent globbing and word splitting. rm -rf $SCRIPT_DIR"/multinet/.git"Double quote to prevent globbing and word splitting. mv $SCRIPT_DIR/multinet/* $SCRIPT_DIRCheck exit code directly with e.g. 'if mycmd;', not indirectly with $?. if [ $? -ne 0 ]; then echo "[build.sh] Moving multinet files failed. Exiting ..." exit 1 fiDouble quote to prevent globbing and word splitting. rm -rf $SCRIPT_DIR/multinetfi echo "[build.sh] Building multinet completed successfully"