From 12f5476a7d738ed4a299e11df7c9cff9c4fa7901 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 2 Nov 2011 14:19:30 +0000 Subject: QPID-3573: handle case where /home/gordon does not exist git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1196597 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/examples/old_api/verify | 13 ++++++++++--- cpp/examples/old_api/verify_all | 8 +++++++- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'cpp/examples') diff --git a/cpp/examples/old_api/verify b/cpp/examples/old_api/verify index 9a1ed078d6..1ee21f6b03 100755 --- a/cpp/examples/old_api/verify +++ b/cpp/examples/old_api/verify @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Licensed to the Apache Software Foundation (ASF) under one @@ -30,9 +30,16 @@ export LC_ALL=C # If $QPID_HOST or $QPID_PORT are set, use them to connect. # -QPID_DATA_DIR= QPID_NO_MODULE_DIR=1 -export QPID_DATA_DIR QPID_NO_MODULE_DIR +QPID_DATA_DIR= + +# Use temporary directory if $HOME does not exist +if [ ! -e "$HOME" ]; then + QPID_DATA_DIR=/tmp/qpid + QPID_PID_DIR=/tmp/qpid +fi + +export QPID_DATA_DIR QPID_NO_MODULE_DIR QPID_PID_DIR cleanup() { test -n "$QPIDD" && $QPIDD -q # Private broker diff --git a/cpp/examples/old_api/verify_all b/cpp/examples/old_api/verify_all index fbe51377b6..e71479d6be 100755 --- a/cpp/examples/old_api/verify_all +++ b/cpp/examples/old_api/verify_all @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Licensed to the Apache Software Foundation (ASF) under one @@ -28,6 +28,12 @@ qpidd=$topbuilddir/src/qpidd broker_args=$3 exclude_regexp=$4 +# Use temporary directory if $HOME does not exist +if ! test -e "$HOME"; then + export QPID_DATA_DIR=/tmp/qpid + export QPID_PID_DIR=/tmp/qpid +fi + trap "$qpidd -q" exit QPID_PORT=`$qpidd -dp0 $broker_args` || { echo "Can't run qpidd" ; exit 1; } export QPID_PORT -- cgit v1.2.1