]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Make ifconfig.sh more resilient to the directory where it is run
authorOndřej Surý <ondrej@sury.org>
Thu, 7 Mar 2019 13:19:39 +0000 (14:19 +0100)
committerOndřej Surý <ondrej@sury.org>
Tue, 19 Mar 2019 14:26:23 +0000 (15:26 +0100)
bin/tests/system/ifconfig.sh

index c6b412a8f2d1fb08a918fb5f3b5cf1a6cbf7df68..051e2d25660eb8cb5857d726544bda77c7b28062 100755 (executable)
 #       fd92:7065:b8e:ff::{1..2}
 #
 
-config_guess=""
-for f in ./config.guess ../../../config.guess /usr/share/automake*/config.guess
-do
-       if test -f $f
-       then
-               config_guess=$f
-       fi
-done
+SYSTEMTESTTOP="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
+. "$SYSTEMTESTTOP/conf.sh"
 
-if test "X$config_guess" = "X"
-then
-       cat <<EOF >&2
-$0: must be run from the top level source directory or the
-bin/tests/system directory
-EOF
-       exit 1
-fi
+export SYSTEMTESTTOP
 
-sys=`sh $config_guess`
+sys=$($SHELL "$TOP/config.guess")
 
 use_ip=
 case "$sys" in