mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-03 22:33:02 +02:00
Add a default message of the day (/etc/motd)
This is injected to the factory-config during bootstrap, and can then be changed as usual via /system/motd.
This commit is contained in:
committed by
Joachim Wiberg
parent
43fbe4e8b1
commit
6ef80d5847
@@ -0,0 +1,4 @@
|
||||
.-------.
|
||||
| . . | Infix -- a Network Operating System
|
||||
|-. v .-| https://kernelkit.github.io
|
||||
'-'---'-'
|
||||
@@ -1,2 +1,2 @@
|
||||
pkglibexec_SCRIPTS = bootstrap error load \
|
||||
gen-hostkeys gen-admin-auth gen-hostname gen-interfaces
|
||||
gen-hostkeys gen-admin-auth gen-hostname gen-interfaces gen-motd
|
||||
|
||||
@@ -97,6 +97,7 @@ factory()
|
||||
|
||||
# Create an overlay for /etc/hostname to change the default in an br2-external
|
||||
gen-hostname >"$FACTORY_D/20-hostname.json"
|
||||
gen-motd >"$FACTORY_D/20-motd.json"
|
||||
# shellcheck disable=SC2086
|
||||
gen-interfaces $GEN_IFACE_OPTS >"$FACTORY_D/20-interfaces.json"
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ -f /etc/motd ]; then
|
||||
cat <<EOF
|
||||
{
|
||||
"ietf-system:system": {
|
||||
"infix-system:motd": "$(sed ':a;N;$!ba;s/\n/\\n/g;s/\t/\\t/g' /etc/motd)"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
else
|
||||
echo "{}"
|
||||
fi
|
||||
Reference in New Issue
Block a user