From: Mark Wooding Date: Tue, 23 Feb 2016 10:10:35 +0000 (+0000) Subject: bin/: Fix preamble to handle invocation through a symlink. X-Git-Url: https://git.distorted.org.uk/~mdw/distorted-letsencrypt/commitdiff_plain/c67523fe0e164edd35d2678295e21395af79d5ac bin/: Fix preamble to handle invocation through a symlink. This depends on GNU coreutils readlink(1), but I think we can live with that. --- diff --git a/bin/le b/bin/le index 11963b5..0ec46b2 100755 --- a/bin/le +++ b/bin/le @@ -1,7 +1,8 @@ #! /bin/sh set -e -. "${0%/*}/../config.sh" -. $home/lib/lib.sh +prog=$(readlink -e "$0") +. "${prog%/*}/../config.sh" +. "$home/lib/lib.sh" run_as_user "$@" prepare_tmp le-user diff --git a/bin/make-cert b/bin/make-cert index b6a86df..19808c6 100755 --- a/bin/make-cert +++ b/bin/make-cert @@ -1,7 +1,8 @@ #! /bin/sh set -e usage=" TAG" -. "${0%/*}/../config.sh" +prog=$(readlink -e "$0") +. "${prog%/*}/../config.sh" . "$home/lib/lib.sh" run_as_user "$@" diff --git a/bin/reissue b/bin/reissue index 32301ef..3758327 100755 --- a/bin/reissue +++ b/bin/reissue @@ -1,7 +1,8 @@ #! /bin/sh set -e usage="" -. "${0%/*}/../config.sh" +prog=$(readlink -e "$0") +. "${prog%/*}/../config.sh" . "$home/lib/lib.sh" run_as_user "$@"