Updating MOTD to suggest ip addresses on login.
Some checks failed
CodeQL / Analyze (push) Has been cancelled

This commit is contained in:
Roland 2025-08-18 11:33:44 -06:00
parent 7bc261a8a3
commit 24a0646f99
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
8 changed files with 57 additions and 49 deletions

View file

@ -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

View file

@ -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

View file

@ -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 ""

View file

@ -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 ""

View file

@ -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 ""

View file

@ -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

View file

@ -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

View file

@ -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