This is the code that I want to execute through motd:
#!/bin/bash
IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
#clear
echo -e "Welcome to \e[0;32mDMS 4\e[0m"
echo
echo -e "Connect with your Browser to following IP-Address: \e[0;32mhttp://$IP\e[0m"
echo
echo "If no IP-Address is shown above then"
echo "maybe there is no DHCP-Server available in your network."
echo "If so you have to change the IP to a static Address."
echo -e "Just type \e[0;32mnetconf\e[0m and press Enter"
I placed /usr/sbin/autologin-screen
(location of the script) in my 00-header
file under the /etc/update-motd.d
folder.
Does anyone have an idea why I am getting this error:
TERM environment variable not set
Note* Removing Clear removed 1 error. I still have another TERM environment variable not set
clear
andshift
andexec $*
do? – Tim Jul 28 '14 at 12:17cat /etc/issue
line... (why is that needed anyway?). – Wilf Jul 28 '14 at 12:28