Tuesday, June 10, 2014

Raspberry Pi Chromium Digital Sign w/ PHP Reboot button

I am following these instructions, but am giving full detail of my instructions.  I am also adding a PHP webpage to reboot the pi remotely without knowing the passwords so other staff can do it.

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install matchbox x11-server-utils unclutter chromium ttf-mscorefonts-installer
sudo reboot

Setup Auto-login
sudo nano /etc/inittab
comment out the line (#)1:2345:respawn:/sbin/getty 115200 tty1
add: 1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1

That is all I did.

sudo apt-get install php5
cd /var/www
sudo rm index.html
sudo nano index.php

        echo "Rebooting NOW<br />\n";
<!DOCTYPE html>
<form action='index.php' method='post'>
<input type='submit' name='s' value='Reboot' />

sudo nano /usr/local/sbin/reboot.sh

if [ -f /tmp/reboot.now ]; then
        rm -f /tmp/reboot.now
        /sbin/shutdown -r now

sudo chmod +x /usr/local/sbin/reboot.sh
sudo crontab -e

* * * * * /usr/local/sbin/reboot.sh