CentOS 7
How do I print something on the text-mode console right after the OS has finished booting?
I've a virtual instance and I need to know its IP address after it has finished booting up, to know where to ssh into it. I've tried adding "ip -4 addr > /dev/tty0" to rc.local, but that obviously doesn't work, because the login prompt overwrites everything I do.
you can send a mail to your mailbox google Raspberry Pi mailip such as http://elinux.org/RPi_Email_IP_On_Boot_Debian
for local network, there is no complicated steps to find the IP just get the hardware address of your card and scan the network with nmap.
-----原始邮件----- 发件人: "Florin Andrei" florin@andrei.myip.org 发送时间: 2014-12-09 07:35:13 (星期二) 收件人: "CentOS mailing list" centos@centos.org 抄送: 主题: [CentOS] print something on console after boot
CentOS 7
How do I print something on the text-mode console right after the OS has finished booting?
I've a virtual instance and I need to know its IP address after it has finished booting up, to know where to ssh into it. I've tried adding "ip -4 addr > /dev/tty0" to rc.local, but that obviously doesn't work, because the login prompt overwrites everything I do.
-- Florin Andrei http://florin.myip.org/
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
-- 深圳市传感器技术重点实验室 深圳大学科技楼303室 518060 手机:18948323721 电话:0755-26538886 传真: 0755-26534656
I might be in left field but...
in init.d create a script that simply
echo_ip
script contents #!/bin/bash ip -4 addr |grep inet |tee /var/log/ip # this will only print the ip lines and copy to /var/log/ip ( I prefer tee over echo, for a variety of reasons)
then create S99echo_ip in rc3.d so that it runs last
then On 12/8/2014 5:35 PM, Florin Andrei wrote:
CentOS 7
How do I print something on the text-mode console right after the OS has finished booting?
I've a virtual instance and I need to know its IP address after it has finished booting up, to know where to ssh into it. I've tried adding "ip -4 addr > /dev/tty0" to rc.local, but that obviously doesn't work, because the login prompt overwrites everything I do.
On 12/10/2014 12:47 PM, Dan Hyatt wrote:
I've a virtual instance and I need to know its IP address after it has finished booting up, to know where to ssh into it. I've tried adding "ip -4 addr > /dev/tty0" to rc.local, but that obviously doesn't work, because the login prompt overwrites everything I do.
The easy answer would be: don't fight the login prompt. "agetty" writes the contents of /etc/issue to the console before the login prompt. If /etc/issue contains "\4" then agetty will print the IPv4 address to the console.
See the man page for agetty, and update /etc/issue.