summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2016-12-04 01:32:21 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2016-12-11 12:27:10 +0000
commit1cf9fd607cd31db1c6d0ef8fdfbc659fbb66fe8b (patch)
tree97b1a1a667d7ae1cdc19fb31d95848a109facc13 /bin
parentAdding upstream version 20161125. (diff)
downloadopen-infrastructure-compute-tools-1cf9fd607cd31db1c6d0ef8fdfbc659fbb66fe8b.tar.xz
open-infrastructure-compute-tools-1cf9fd607cd31db1c6d0ef8fdfbc659fbb66fe8b.zip
Adding upstream version 20161201.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/container31
-rwxr-xr-xbin/container-shell2
2 files changed, 32 insertions, 1 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}"
diff --git a/bin/container-shell b/bin/container-shell
index 9b45f72..3a14f7d 100755
--- a/bin/container-shell
+++ b/bin/container-shell
@@ -87,7 +87,7 @@ Shell ()
return
else
echo
- sudo "/usr/lib/${SOFTWARE}/${PROGRAM}/${COMMAND}" "${OPTIONS}" || true
+ sudo ${PROGRAM} ${COMMAND} ${OPTIONS} || true
fi
}