summaryrefslogtreecommitdiffstats
path: root/bin/container
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2016-12-11 12:34:23 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2016-12-11 12:34:23 +0000
commit83e6c0c55c255c069e5ee5bf9cb2d8d5f2b83f2a (patch)
treed10157feb045e099bacae644b0832c1522560f07 /bin/container
parentAdding upstream version 20161201. (diff)
downloadopen-infrastructure-compute-tools-83e6c0c55c255c069e5ee5bf9cb2d8d5f2b83f2a.tar.xz
open-infrastructure-compute-tools-83e6c0c55c255c069e5ee5bf9cb2d8d5f2b83f2a.zip
Adding upstream version 20161210.upstream/20161210
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'bin/container')
-rwxr-xr-xbin/container20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/container b/bin/container
index 484a0e1..5b97d3e 100755
--- a/bin/container
+++ b/bin/container
@@ -21,6 +21,8 @@ set -e
SOFTWARE="container-tools"
PROGRAM="container"
+HOOKS="/etc/${SOFTWARE}/hooks"
+
# Parameter
PARAMETER="${1}"
@@ -43,6 +45,15 @@ fi
shift 1
OPTIONS="${@}"
+# Pre hooks
+for FILE in "${HOOKS}/pre-${PROGRAM}".* "${HOOKS}/${NAME}.pre-${PROGRAM}"
+do
+ if [ -x "${FILE}" ]
+ then
+ "${FILE}"
+ fi
+done
+
# Notification
if echo "${OPTIONS}" | grep -qs "\--no-notification"
then
@@ -76,3 +87,12 @@ fi
# Run
exec "/usr/lib/${SOFTWARE}/${PROGRAM}/${COMMAND}" "${OPTIONS}"
+
+# Post hooks
+for FILE in "${HOOKS}/post-${PROGRAM}".* "${HOOKS}/${NAME}.post-${PROGRAM}"
+do
+ if [ -x "${FILE}" ]
+ then
+ "${FILE}"
+ fi
+done