summaryrefslogtreecommitdiffstats
path: root/bin/container
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2016-12-04 01:32:25 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2016-12-04 01:49:34 +0000
commitac7bf8134162fa3fb4a2931d012aa72c123a8363 (patch)
tree62f519a89b1157a4a61f1aa16f8148cfdbdab9dd /bin/container
parentReleasing debian version 20161125-1. (diff)
downloadopen-infrastructure-compute-tools-ac7bf8134162fa3fb4a2931d012aa72c123a8363.tar.xz
open-infrastructure-compute-tools-ac7bf8134162fa3fb4a2931d012aa72c123a8363.zip
Merging upstream version 20161201.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'bin/container')
-rwxr-xr-xbin/container31
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/container b/bin/container
index f644e6d..484a0e1 100755
--- a/bin/container
+++ b/bin/container
@@ -43,5 +43,36 @@ fi
shift 1
OPTIONS="${@}"
+# Notification
+if echo "${OPTIONS}" | grep -qs "\--no-notification"
+then
+ OPTIONS="$(echo "${OPTIONS}" | sed -e 's|--no-notification||')"
+else
+ case "${COMMAND}" in
+ create|remove|rm|restart|start|stop)
+ USER="${SUDO_USER:-${USER}}"
+ DATE="$(date +%Y-%m-%d\ %H:%M:%S)"
+ HOST="$(hostname -f)"
+
+ # logfile
+ echo "${DATE} ${HOST} ${USER} ${PROGRAM} ${COMMAND} ${OPTIONS}" >> "/var/log/${SOFTWARE}/${PROGRAM}.log"
+
+ # irc
+ if [ -e /usr/bin/irk ] && [ -e "/etc/default/${SOFTWARE}" ]
+ then
+ . /etc/default/${SOFTWARE}
+
+ if [ -n "${IRK_TARGETS}" ]
+ then
+ for TARGET in ${IRK_TARGETS}
+ do
+ irk ${TARGET} "\x0300${USER}\x03@\x0312${HOST}:\x03 \x0303${PROGRAM}\x03 \x0307${COMMAND}\x03 ${OPTIONS}"
+ done
+ fi
+ fi
+ ;;
+ esac
+fi
+
# Run
exec "/usr/lib/${SOFTWARE}/${PROGRAM}/${COMMAND}" "${OPTIONS}"