chiark
/
gitweb
/
~mdw
/
rcheck
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
3e7a8d2
)
rcheck: Hunt down directory by chasing symlinks.
author
Mark Wooding
<mdw@distorted.org.uk>
Wed, 22 Jun 2011 08:13:29 +0000
(09:13 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Wed, 22 Jun 2011 08:13:29 +0000
(09:13 +0100)
Better than hardwiring it.
rcheck
patch
|
blob
|
blame
|
history
diff --git
a/rcheck
b/rcheck
index 84e7c51d5e5593ab8f0d637c9f5b247b2112ea82..cd40440567e622218afcfab597d44031404a021d 100755
(executable)
--- 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