diff options
Diffstat (limited to 'bin')
-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 } |