Print executed and skiped hooks

This commit is contained in:
Daniel Berteaud 2022-07-01 16:15:28 +02:00
parent 13e6ef7e6a
commit 1655297695
1 changed files with 7 additions and 1 deletions

View File

@ -3,8 +3,14 @@
ACTION=${1}
if [ -d "/etc/dehydrated/hooks_"$ACTION".d" ]; then
echo Executing hooks for $ACTION event
shift
for H in $(find /etc/dehydrated/hooks_"$ACTION".d/ -type f -o -type l | sort); do
[ -x $H ] && $H $@
if [ -x $H ]; then
echo Running $H hook
$H $@
else
echo $H is not executable, skiping
fi
done
fi