From f91a618e02dcf4c8e1e702e6f50ca503d25145c7 Mon Sep 17 00:00:00 2001 From: Tanya Degurechaff <34323200+TanyaEleventhGoddess@users.noreply.github.com> Date: Sun, 5 Jul 2020 11:10:51 +0200 Subject: [PATCH] Avoid warning 'stdin not a tty' in some cases Signed-off-by: Tanya Degurechaff <34323200+TanyaEleventhGoddess@users.noreply.github.com> --- templates/lxc-debian.in | 5 +++++ templates/lxc-kali.in | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in index 97a38a9..49073b0 100644 --- a/templates/lxc-debian.in +++ b/templates/lxc-debian.in @@ -594,6 +594,11 @@ EOF # Re-enable service startup rm "${rootfs}/usr/sbin/policy-rc.d" + + # Fix by Greg Olsen, avoid warning 'stdin not a tty' in some cases + if [[ -f "${rootfs}/root/.profile" ]]; then + sed -i -e 's/^mesg n/test -t 0 \&\& mesg n/g' ${rootfs}/root/.profile + fi # end } diff --git a/templates/lxc-kali.in b/templates/lxc-kali.in index 68a66fe..ef8cd01 100755 --- a/templates/lxc-kali.in +++ b/templates/lxc-kali.in @@ -570,6 +570,11 @@ EOF # Re-enable service startup rm "${rootfs}/usr/sbin/policy-rc.d" + + # Fix by Greg Olsen, avoid warning 'stdin not a tty' in some cases + if [[ -f "${rootfs}/root/.profile" ]]; then + sed -i -e 's/^mesg n/test -t 0 \&\& mesg n/g' ${rootfs}/root/.profile + fi # end }