我已经完成了以下shell脚本,这些脚本/etc/issue
以所有非环回接口的当前ip更新了该shell脚本:
#!/bin/sh
echo "You can use one of the following ip addresses in order to look the page or even ssh into the machine" > /etc/issue
ip -4 -o addr show up scope global | awk '{print $2,":",$4}'| sed -e "s/\/[1-9]*//" >> /etc/issue
现在,我想使其在启动时运行,以便/etc/issue
使用网络ips更新。在基于Debian的发行版上,我将其放置在上面,/etc/rc.local
但是alpine没有此文件。我将如何使该脚本以等效的方式运行/etc/rc.local
?
我尝试穿上它,/etc/local.d
但未能正确更改/etc/issue
您必须local.d
在启动时启用脚本:
rc-update add local default
然后只需将脚本放入其中/etc/local.d/UpdateIssue.start
并使其可执行即可。
您可以local.d
在Gentoo Wiki上找到有关OpenRC中脚本的更多详细信息:
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句