War*_*ine 9 server login 11.04
motd.tail根据此错误报告已弃用:
motd(5) says: "The contents of this file are regenerated upon every system
boot based on the contents of /etc/motd.tail." This is not true anymore, as
Ubuntu uses the update-motd framework. Any reference to motd.tail should be
replaced with a reference to the update-motd framework or update-motd(5).
The manpage for motd.tail should be removed.
Run Code Online (Sandbox Code Playgroud)
我在登录时使用它来识别我的服务器并确保我在正确的机器上,所以我不需要任何动态,只需要一条简单的消息。
motd.tail与适用于 Ubuntu 11.04 的(在 MOTD 末尾附加一条小消息)的等效项是什么?
要直接回答问题,只需编辑/etc/update-motd.d/99-footer.
这/etc/update-motd.d/是一个相当标准的配置转储,按文件名排序。99-footer是那里的最后一件事,所以最后被螺栓固定。默认情况下,在 Natty 中,这只是检查是否有一个文件被调用/etc/motd.tail,如果有,它会将其附加到 motd:
[ -f /etc/motd.tail ] && cat /etc/motd.tail || true
Run Code Online (Sandbox Code Playgroud)
所以你有两个选择。您可以在其中添加更多逻辑到echo一些输出(这是一个 shell 脚本,毕竟不是文本文件),或者您可以创建(或编辑,如果您已经有了)/etc/motd.tail。无论哪种方式都是完全有效的。