summaryrefslogtreecommitdiffstats
path: root/libexec/container/log
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xlibexec/container/log (renamed from lib/container/log)25
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/container/log b/libexec/container/log
index a18c421..e514391 100755
--- a/lib/container/log
+++ b/libexec/container/log
@@ -15,15 +15,17 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
set -e
PROJECT="open-infrastructure"
+SOFTWARE="compute-tools"
PROGRAM="container"
COMMAND="$(basename ${0})"
-LOG="/var/log/${PROJECT}/${PROGRAM}.log"
+HOOKS="/etc/${SOFTWARE}/hooks"
+LOG="/var/log/${SOFTWARE}/${PROGRAM}.log"
Parameters ()
{
@@ -79,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 }')"
@@ -141,3 +153,12 @@ do
;;
esac
done
+
+# Post hooks
+for FILE in "${HOOKS}/post-${COMMAND}".*
+do
+ if [ -x "${FILE}" ]
+ then
+ "${FILE}"
+ fi
+done