From e07edad5f45907e9c7f4d6c24823b80cbe282316 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 29 Jun 2021 13:29:23 +0200 Subject: Adding upstream version 20210628. Signed-off-by: Daniel Baumann --- bin/container | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/container b/bin/container index c3748d9..3e329c9 100755 --- a/bin/container +++ b/bin/container @@ -66,12 +66,16 @@ do else case "${COMMAND}" in create|cr|move|mv|remove|rm|restart|rt|start|s|stop|t) - USER="${SUDO_USER:-${USER}}" + if [ -z "${CONTAINER_USER}" ] + then + CONTAINER_USER="${SUDO_USER:-${USER}}" + fi + DATE="$(date +%Y-%m-%d\ %H:%M:%S)" HOST="$(hostname -f 2> /dev/null || hostname)" # logfile - echo "${DATE} ${HOST} ${USER} ${PROGRAM} ${COMMAND} ${OPTIONS}" >> "/var/log/${SOFTWARE}/${PROGRAM}.log" + echo "${DATE} ${HOST} ${CONTAINER_USER} ${PROGRAM} ${COMMAND} ${OPTIONS}" >> "/var/log/${SOFTWARE}/${PROGRAM}.log" # irc if [ -e /usr/bin/irk ] && [ -e "/etc/${SOFTWARE}.conf" ] @@ -82,7 +86,7 @@ do then for TARGET in ${IRK_TARGETS} do - irk ${TARGET} "\x0300${USER}\x03@\x0312${HOST}:\x03 \x0303${PROGRAM}\x03 \x0307${COMMAND}\x03 ${OPTIONS}" + irk ${TARGET} "\x0300${CONTAINER_USER}\x03@\x0312${HOST}:\x03 \x0303${PROGRAM}\x03 \x0307${COMMAND}\x03 ${OPTIONS}" done fi fi -- cgit v1.2.3