diff --git a/debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot b/debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot index 1b5f5d14..3107c2f9 100644 --- a/debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot +++ b/debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot @@ -60,7 +60,11 @@ cp /opt/wrolpi/etc/raspberrypios/wrolpi-*.service /etc/systemd/system/ cp /opt/wrolpi/etc/raspberrypios/wrolpi.target /etc/systemd/system/ cp /opt/wrolpi/etc/raspberrypios/renderd.conf /etc/renderd.conf -cp /opt/wrolpi/etc/raspberrypios/motd_first /etc/motd +# Copy MOTD scripts, delete original. +cp /opt/wrolpi/etc/raspberrypios/motd/20-wrolpi.motd /etc/update-motd.d/20-wrolpi +cp /opt/wrolpi/etc/raspberrypios/motd/30-wrolpi-first.motd /etc/update-motd.d/30-wrolpi +chmod +x /etc/update-motd.d/* +truncate -s 0 /etc/motd # NetworkManager for the hotspot. systemctl enable NetworkManager diff --git a/etc/raspberrypios/motd b/etc/raspberrypios/motd deleted file mode 100644 index 6a68b6bd..00000000 --- a/etc/raspberrypios/motd +++ /dev/null @@ -1,21 +0,0 @@ -The programs included with the Debian GNU/Linux system are free software; -the exact distribution terms for each program are described in the -individual files in /usr/share/doc/*/copyright. - -Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent -permitted by applicable law. - -██╗ ██╗██████╗ ██████╗ ██╗ ██████╗ ██╗ -██║ ██║██╔══██╗██╔═══██╗██║ ██╔══██╗ ║ -██║ █╗ ██║██████╔╝██║ ██║██║ ██████╔╝██ -██║███╗██║██╔══██╗██║ ██║██║ ██╔═══╝ ██║ -╚███╔███╔╝██║ ██║╚██████╔╝███████╗██║ ██║ - ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ - - Welcome to your WROLPi! - - Run the help script to find potential problems: - /opt/wrolpi/help.sh - -Help documentation is available: https://wrolpi.local:8086 or /opt/wrolpi-help/docs - diff --git a/etc/raspberrypios/motd/20-wrolpi.motd b/etc/raspberrypios/motd/20-wrolpi.motd new file mode 100755 index 00000000..e68d5506 --- /dev/null +++ b/etc/raspberrypios/motd/20-wrolpi.motd @@ -0,0 +1,16 @@ +#!/bin/sh +echo "" +echo "The programs included with the Debian GNU/Linux system are free software;" +echo "the exact distribution terms for each program are described in the" +echo "individual files in /usr/share/doc/*/copyright." +echo "" +echo "Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent" +echo "permitted by applicable law." +echo "" +echo "██╗ ██╗██████╗ ██████╗ ██╗ ██████╗ ██╗" +echo "██║ ██║██╔══██╗██╔═══██╗██║ ██╔══██╗ ║" +echo "██║ █╗ ██║██████╔╝██║ ██║██║ ██████╔╝██" +echo "██║███╗██║██╔══██╗██║ ██║██║ ██╔═══╝ ██║" +echo "╚███╔███╔╝██║ ██║╚██████╔╝███████╗██║ ██║" +echo " ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝" +echo "" diff --git a/etc/raspberrypios/motd/30-wrolpi-first.motd b/etc/raspberrypios/motd/30-wrolpi-first.motd new file mode 100755 index 00000000..c2f39a0c --- /dev/null +++ b/etc/raspberrypios/motd/30-wrolpi-first.motd @@ -0,0 +1,17 @@ +#!/bin/sh + +ip_address=$(ip addr show eth0 | grep -oP 'inet \K[\d.]+') +hostname="$(hostname).local" + +echo "Welcome to your new WROLPi! Follow the steps below to finish the setup:" +echo "" +echo " 1. If you have an external drive, mount it to /media/wrolpi" +echo " 2. Run the repair script: /opt/wrolpi/repair.sh" +echo " 3. Refresh your files in the UI at https://${hostname} or https://127.0.0.1" +echo "" +echo "Run the help script to find potential problems:" +echo " /opt/wrolpi/help.sh" +echo "" +echo "Help documentation is available: https://${ip_address}:8086" +echo " or in this directory /opt/wrolpi-help/docs" +echo "" diff --git a/etc/raspberrypios/motd/30-wrolpi.motd b/etc/raspberrypios/motd/30-wrolpi.motd new file mode 100755 index 00000000..866e2b4e --- /dev/null +++ b/etc/raspberrypios/motd/30-wrolpi.motd @@ -0,0 +1,12 @@ +#!/bin/sh + +ip_address=$(ip addr show eth0 | grep -oP 'inet \K[\d.]+') + +echo " Welcome to your WROLPi!" +echo "" +echo " Run the help script to find potential problems:" +echo " /opt/wrolpi/help.sh" +echo "" +echo " Help documentation is available: https://${ip_address}:8086" +echo " or in this directory /opt/wrolpi-help/docs" +echo "" diff --git a/etc/raspberrypios/motd_first b/etc/raspberrypios/motd_first deleted file mode 100644 index b44530ff..00000000 --- a/etc/raspberrypios/motd_first +++ /dev/null @@ -1,25 +0,0 @@ -The programs included with the Debian GNU/Linux system are free software; -the exact distribution terms for each program are described in the -individual files in /usr/share/doc/*/copyright. - -Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent -permitted by applicable law. - -██╗ ██╗██████╗ ██████╗ ██╗ ██████╗ ██╗ -██║ ██║██╔══██╗██╔═══██╗██║ ██╔══██╗ ║ -██║ █╗ ██║██████╔╝██║ ██║██║ ██████╔╝██ -██║███╗██║██╔══██╗██║ ██║██║ ██╔═══╝ ██║ -╚███╔███╔╝██║ ██║╚██████╔╝███████╗██║ ██║ - ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ - -Welcome to your new WROLPi! Follow the steps below to finish the setup: - - 1. If you have an external drive, mount it to /media/wrolpi - 2. Run the repair script: /opt/wrolpi/repair.sh - 3. Refresh your files in the UI at https://wrolpi.local or https://127.0.0.1 - -Run the help script to find potential problems: - /opt/wrolpi/help.sh - -Help documentation is available: https://wrolpi.local:8086 or /opt/wrolpi-help/docs - diff --git a/pi-gen/stage2/04-wrolpi/03-run-chroot.sh b/pi-gen/stage2/04-wrolpi/03-run-chroot.sh index 06e6e4c4..cc873622 100755 --- a/pi-gen/stage2/04-wrolpi/03-run-chroot.sh +++ b/pi-gen/stage2/04-wrolpi/03-run-chroot.sh @@ -53,7 +53,11 @@ cp /opt/wrolpi/etc/raspberrypios/wrolpi.target /etc/systemd/system/ # Enable first startup script. systemctl enable wrolpi-first-startup.service -cp /opt/wrolpi/etc/raspberrypios/motd_first /etc/motd +# Copy MOTD scripts, delete original. +cp /opt/wrolpi/etc/raspberrypios/motd/20-wrolpi.motd /etc/update-motd.d/20-wrolpi +cp /opt/wrolpi/etc/raspberrypios/motd/30-wrolpi-first.motd /etc/update-motd.d/30-wrolpi +chmod +x /etc/update-motd.d/* +truncate -s 0 /etc/motd # NetworkManager for the hotspot. systemctl enable NetworkManager diff --git a/repair.sh b/repair.sh index 53d281cb..559b077a 100755 --- a/repair.sh +++ b/repair.sh @@ -144,7 +144,8 @@ chown wrolpi:wrolpi /media/wrolpi 2>/dev/null || echo "Ignoring failure to chang chown -R wrolpi:wrolpi /home/wrolpi /opt/wrolpi* # Copy MOTD once the repair has been successful. -cp /opt/wrolpi/etc/raspberrypios/motd /etc/motd +cp /opt/wrolpi/etc/raspberrypios/motd/30-wrolpi.motd /etc/update-motd.d/30-wrolpi +chmod +x /etc/update-motd.d/* systemctl restart renderd systemctl restart wrolpi-help