Fix scripts to work when invoked from other directories.

This commit is contained in:
Ricardo M. Correia 2010-03-09 14:51:49 -08:00 committed by Brian Behlendorf
parent 6b61087168
commit 17c7323211
3 changed files with 12 additions and 6 deletions

View File

@ -2,9 +2,11 @@
# #
# ZFS/ZPOOL configuration test script. # ZFS/ZPOOL configuration test script.
basedir="$(dirname $0)"
SCRIPT_COMMON=common.sh SCRIPT_COMMON=common.sh
if [ -f ./${SCRIPT_COMMON} ]; then if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
. ./${SCRIPT_COMMON} . "${basedir}/${SCRIPT_COMMON}"
elif [ -f /usr/libexec/zfs/${SCRIPT_COMMON} ]; then elif [ -f /usr/libexec/zfs/${SCRIPT_COMMON} ]; then
. /usr/libexec/zfs/${SCRIPT_COMMON} . /usr/libexec/zfs/${SCRIPT_COMMON}
else else

View File

@ -3,9 +3,11 @@
# Wrapper script for easily running a survey of zpios based tests # Wrapper script for easily running a survey of zpios based tests
# #
basedir="$(dirname $0)"
SCRIPT_COMMON=common.sh SCRIPT_COMMON=common.sh
if [ -f ./${SCRIPT_COMMON} ]; then if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
. ./${SCRIPT_COMMON} . "${basedir}/${SCRIPT_COMMON}"
elif [ -f /usr/libexec/zfs/${SCRIPT_COMMON} ]; then elif [ -f /usr/libexec/zfs/${SCRIPT_COMMON} ]; then
. /usr/libexec/zfs/${SCRIPT_COMMON} . /usr/libexec/zfs/${SCRIPT_COMMON}
else else

View File

@ -3,9 +3,11 @@
# Wrapper script for easily running zpios based tests # Wrapper script for easily running zpios based tests
# #
basedir="$(dirname $0)"
SCRIPT_COMMON=common.sh SCRIPT_COMMON=common.sh
if [ -f ./${SCRIPT_COMMON} ]; then if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
. ./${SCRIPT_COMMON} . "${basedir}/${SCRIPT_COMMON}"
elif [ -f /usr/libexec/zfs/${SCRIPT_COMMON} ]; then elif [ -f /usr/libexec/zfs/${SCRIPT_COMMON} ]; then
. /usr/libexec/zfs/${SCRIPT_COMMON} . /usr/libexec/zfs/${SCRIPT_COMMON}
else else