summaryrefslogtreecommitdiff
path: root/cpp/examples/old_api/verify
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2011-11-02 14:19:30 +0000
committerGordon Sim <gsim@apache.org>2011-11-02 14:19:30 +0000
commit12f5476a7d738ed4a299e11df7c9cff9c4fa7901 (patch)
tree5dd8ca5580c3bfda003b4b1e55d54d7b3def5091 /cpp/examples/old_api/verify
parentf372202f9cf85fea7e80695f177ecb14b9fceb9d (diff)
downloadqpid-python-12f5476a7d738ed4a299e11df7c9cff9c4fa7901.tar.gz
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
Diffstat (limited to 'cpp/examples/old_api/verify')
-rwxr-xr-xcpp/examples/old_api/verify13
1 files changed, 10 insertions, 3 deletions
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