summaryrefslogtreecommitdiffstats
path: root/libexec/container
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/container')
-rwxr-xr-xlibexec/container/log20
1 files changed, 20 insertions, 0 deletions
diff --git a/libexec/container/log b/libexec/container/log
index 2378eb4..d0dc4af 100755
--- a/libexec/container/log
+++ b/libexec/container/log
@@ -24,6 +24,7 @@ SOFTWARE="compute-tools"
PROGRAM="container"
COMMAND="$(basename ${0})"
+HOOKS="/etc/${SOFTWARE}/hooks"
LOG="/var/log/${SOFTWARE}/${PROGRAM}.log"
Parameters ()
@@ -80,6 +81,16 @@ Usage ()
Parameters "${@}"
+# Pre hooks
+for FILE in "${HOOKS}/pre-${COMMAND}".*
+do
+ if [ -x "${FILE}" ]
+ then
+ "${FILE}"
+ fi
+done
+
+# Run
case "${DATE}" in
today-*)
DAYS="$(echo ${DATE} | awk -F- '{ print $2 }')"
@@ -142,3 +153,12 @@ do
;;
esac
done
+
+# Post hooks
+for FILE in "${HOOKS}/post-${COMMAND}".*
+do
+ if [ -x "${FILE}" ]
+ then
+ "${FILE}"
+ fi
+done