Sigh.
realpath is "portable", except not implemented on older versions of
coreutils, including the one in Ubuntu Trusty :-(
So, default to using realpath (which has the advantage of not requiring
options anywhere), and fall back to readlink -f if that doesn't exist in
our path.
If that also fails, then the test suite will fail, but have a nice
"readlink: -f: invalid option" or some such all over it, pointing to
what the likely culprit is.
then
TMPDIR=/tmp
fi
+
+REALPATH=$(which realpath)
+if [ -z "$REALPATH" ]
+then
+ REALPATH="readlink -f"
+fi
+
tmpdir=`mktemp -d $TMPDIR/tmp.XXXXXX`
conffile=${tmpdir}/nbd.conf
pidfile=${tmpdir}/nbd.pid
tmpnam=${tmpdir}/nbd.dd
mydir=$(dirname $0)
-certdir=$(realpath ${mydir}/certs)
+certdir=$($REALPATH ${mydir}/certs)
cleanup="$2"
PID=""