aboutsummaryrefslogtreecommitdiff
path: root/afssh
diff options
context:
space:
mode:
authorTimo Weingärtner <timo@tiwe.de>2016-10-11 14:25:39 +0200
committerTimo Weingärtner <timo@tiwe.de>2016-10-11 14:25:39 +0200
commit2f994963899ca8e039dd0aa38884693a9928e116 (patch)
tree1a82f28bde90ee1a56b7b73f3d739592cceb1911 /afssh
parentf8e42e89e3404f91d397e325c94af6494786e90f (diff)
downloadssh-agent-filter-2f994963899ca8e039dd0aa38884693a9928e116.tar.gz
afssh: use realpath instead of readlink -f, with fallback
this add compatibility for some BSD systems which don't have -f to readlink while retaining compatibility with GNU systems without a readlink command Thanks: Konstantinos Koukopoulos <kouk@transifex.com>
Diffstat (limited to 'afssh')
-rwxr-xr-xafssh4
1 files changed, 3 insertions, 1 deletions
diff --git a/afssh b/afssh
index c482aea..3899fba 100755
--- a/afssh
+++ b/afssh
@@ -51,8 +51,10 @@ fi
declare -a agent_filter_args
+type realpath >/dev/null 2>&1 || realpath () { readlink -f "$@"; }
+
if [ -x "${BASH_SOURCE%/*}/ssh-agent-filter" ]; then
- SAF=$(readlink -f "${BASH_SOURCE%/*}/ssh-agent-filter")
+ SAF=$(realpath "${BASH_SOURCE%/*}/ssh-agent-filter")
else
SAF=$(which ssh-agent-filter)
fi