summaryrefslogtreecommitdiffstats
path: root/bin/container
diff options
context:
space:
mode:
Diffstat (limited to '')
-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
}