From c57f861235add6b95e81c9835e5078452d342e7c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 11 Dec 2016 13:34:28 +0100 Subject: Merging upstream version 20161210. Signed-off-by: Daniel Baumann --- bin/container | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'bin') 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 -- cgit v1.2.3