Your Name 1 year ago
parent
commit
85e1ec8c63
1 changed files with 7 additions and 3 deletions
  1. 7 3
      optional/clock_autostart.sh

+ 7 - 3
optional/clock_autostart.sh

@@ -1,8 +1,12 @@
 #!/bin/bash
 #!/bin/bash
 if ! grep "luma.led_matrix" /etc/rc.local >/dev/null
 if ! grep "luma.led_matrix" /etc/rc.local >/dev/null
 then
 then
-sudo bash -c 'sed -i -e "s/exit 0//g" /etc/rc.local'
-sudo bash -c 'echo "python3 /mnt/dietpi_userdata/luma.led_matrix/examples/silly_clock.py &" >>/etc/rc.local'
-sudo bash -c 'echo "exit 0" >>/etc/rc.local'
+sudo sed -i -e "s/exit 0//g" /etc/rc.local
+cat <<'EOF'>> /etc/rc.local
+_IP=$(hostname -I) || true
+python3 /mnt/dietpi_userdata/luma.led_matrix/examples/view_message.py -t "$_IP     $_IP"
+python3 /mnt/dietpi_userdata/luma.led_matrix/examples/silly_clock.py &
+exit 0
+EOF
 fi
 fi