Skip to content
Snippets Groups Projects
Commit 039dc053 authored by Axel Hahn's avatar Axel Hahn
Browse files

function to exec all hook scripts of a given hook

parent e9fae960
No related branches found
No related tags found
1 merge request!80Add hooks
...@@ -179,6 +179,26 @@ function _j_getvar(){ ...@@ -179,6 +179,26 @@ function _j_getvar(){
# read local jobdescription and set as variables # read local jobdescription and set as variables
# ------------------------------------------------------------ # ------------------------------------------------------------
# ------------------------------------------------------------
# execute hook skripts in a given directory in alphabetic order
# param string name of hook directory
# ------------------------------------------------------------
function _j_runHooks(){
local _hookdir=$1
echo ">>> HOOKS $_hookdir"
for hookscript in $( ls -1a "$_hookdir" | grep -v "^\.*$" | sort )
do
if [ -x "$hookscript" ]; then
echo "start $hookscript ..."
$hookscript
else
echo "SKIP: $hookscript (not executable)"
fi
done
echo
}
# ------------------------------------------------------------ # ------------------------------------------------------------
# parse day of week and day of month and echo 0 or 1 # parse day of week and day of month and echo 0 or 1
# #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment