summaryrefslogtreecommitdiffstats
path: root/lib/container/list
diff options
context:
space:
mode:
Diffstat (limited to 'lib/container/list')
-rwxr-xr-xlib/container/list19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/container/list b/lib/container/list
index 3073853..f9f46fb 100755
--- a/lib/container/list
+++ b/lib/container/list
@@ -21,6 +21,7 @@ set -e
COMMAND="$(basename ${0})"
CONFIG="/etc/container-tools/config"
+HOOKS="/etc/container-tools/hooks"
MACHINES="/var/lib/machines"
VERSION="$(container version)"
@@ -115,6 +116,15 @@ HOST="${HOST:-$(hostname -f)}"
CSV_SEPARATOR="${CSV_SEPARATOR:-,}"
+# Pre hooks
+for FILE in "${HOOKS}/pre-${COMMAND}".* "${HOOKS}/${NAME}.pre-${COMMAND}"
+do
+ if [ -x "${FILE}" ]
+ then
+ "${FILE}"
+ fi
+done
+
# Run
List ()
{
@@ -403,3 +413,12 @@ EOF
;;
esac
+
+# Post hooks
+for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}"
+do
+ if [ -x "${FILE}" ]
+ then
+ "${FILE}"
+ fi
+done