summaryrefslogtreecommitdiffstats
path: root/lib/container/restart
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xlib/container/restart19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/container/restart b/lib/container/restart
index 468b297..1c4c591 100755
--- a/lib/container/restart
+++ b/lib/container/restart
@@ -20,6 +20,7 @@ set -e
COMMAND="$(basename ${0})"
+HOOKS="/etc/container-tools/hooks"
MACHINES="/var/lib/machines"
Parameters ()
@@ -77,5 +78,23 @@ then
exit 1
fi
+# Pre hooks
+for FILE in "${HOOKS}/pre-${COMMAND}".* "${HOOKS}/${NAME}.pre-${COMMAND}"
+do
+ if [ -x "${FILE}" ]
+ then
+ "${FILE}"
+ fi
+done
+
# Run
machinectl reboot ${NAME}
+
+# Post hooks
+for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}"
+do
+ if [ -x "${FILE}" ]
+ then
+ "${FILE}"
+ fi
+done