diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2016-12-04 01:32:25 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2016-12-04 01:49:34 +0000 |
commit | ac7bf8134162fa3fb4a2931d012aa72c123a8363 (patch) | |
tree | 62f519a89b1157a4a61f1aa16f8148cfdbdab9dd /bin/container | |
parent | Releasing debian version 20161125-1. (diff) | |
download | open-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 '')
-rwxr-xr-x | bin/container | 31 | ||||
-rwxr-xr-x | bin/container-shell | 2 |
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 } |