可乐博客

CentOS7 配置登录前显示IP

cp /etc/issue /etc/issue_standard


vim /etc/init.d/show_ip.sh
#!/bin/bash

cp /etc/issue_standard /etc/issue
/usr/sbin/ip addr | grep "inet" |grep -v "inet6" | grep -v "127.0.0.1" | awk '{print $2}' >> /etc/issue
echo "" >> /etc/issue

echo "/etc/init.d/show_ip.sh" >> /etc/rc.local
chmod a+x /etc/init.d/show_ip.sh
chmod a+x /etc/rc.local

CentOS7 配置登录前显示IP - ~椰子 - 博客园

随笔