aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorAndré Erdmann <dywi@mailerd.de>2013-09-06 11:56:14 +0200
committerAndré Erdmann <dywi@mailerd.de>2013-09-06 12:05:00 +0200
commitcac0ebaee367d638cb7e9faf510b2aca77275051 (patch)
tree8e4569d6af495f49af255784d080049ad25c56bb /files
parentfiles/shlib/functions: sync_allowed(), $this (diff)
downloadR_overlay-cac0ebaee367d638cb7e9faf510b2aca77275051.tar.gz
R_overlay-cac0ebaee367d638cb7e9faf510b2aca77275051.tar.bz2
R_overlay-cac0ebaee367d638cb7e9faf510b2aca77275051.zip
files/hooks/mux.sh: set $this
Diffstat (limited to 'files')
-rwxr-xr-xfiles/hooks/mux.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/files/hooks/mux.sh b/files/hooks/mux.sh
index 80bff31..efda723 100755
--- a/files/hooks/mux.sh
+++ b/files/hooks/mux.sh
@@ -17,6 +17,7 @@ export LC_CTYPE
## load $ROVERLAY_HOOKRC (if set)
if [ -n "${ROVERLAY_HOOKRC-}" ]; then
+ veinfo "Loading hook config file '${ROVERLAY_HOOKRC}'"
. "${ROVERLAY_HOOKRC}" || \
die "failed to load ROVERLAY_HOOKRC (${ROVERLAY_HOOKRC})."
fi
@@ -32,7 +33,15 @@ do
#subshell?
#( . "${hookfile}"; ) || ...
- veinfo "Running hook '${hookfile##*/}'"
+ hookfile_name="${hookfile##*/}"
+ this="${hookfile_name#[0-9]*-}"; this="${this%.*}"
+
+ if [ -n "${this}" ]; then
+ veinfo "Running hook ${this} ('${hookfile_name}')"
+ else
+ this="${hookfile_name}"
+ veinfo "Running hook '${hookfile_name}'"
+ fi
# initial directory should always be $S
cd "${S}" && . "${hookfile}" || \
@@ -40,6 +49,9 @@ do
# restore signals
trap - INT TERM EXIT
+
+ this="${SCRIPT_NAME}"
+ unset -v hookfile_name
fi
done