From 0c159fe7698d0a510b649e645c1c5e680eee37e6 Mon Sep 17 00:00:00 2001 Message-Id: <0c159fe7698d0a510b649e645c1c5e680eee37e6.1714124611.git.mdw@distorted.org.uk> From: Mark Wooding Date: Wed, 22 Jun 2011 09:13:29 +0100 Subject: [PATCH] rcheck: Hunt down directory by chasing symlinks. Organization: Straylight/Edgeware From: Mark Wooding Better than hardwiring it. --- rcheck | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rcheck b/rcheck index 84e7c51..cd40440 100755 --- a/rcheck +++ b/rcheck @@ -3,7 +3,14 @@ ### Run everyday health checks on remote systems. set -e -cd /usr/local/share/rcheck +prog=$0 +while + case "$prog" in */*) ;; *) prog=./$prog ;; esac + cd "${prog%/*}" + [ -L "${prog##*/}" ] +do + prog=$(readlink "${prog##*/}") +done for host in "$@"; do -- [mdw]