A remake of the chicken coop with Raspberry Pi and NodeJS
npm install
npm start
http://localhost:9000/door/open
http://localhost:9000/door/close
Create a shell script which runs git pull
on the project directory before npm start
. Make sure to make boot completed only after network connectivity.
On Raspberry Pi, use sudo crontab -e
and then add @reboot [THE SHELL SCRIPT YOU JUST CREATED]
to the bottom of the file. @reboot
runs the script automatically upon every boot.
Another option is to use upstart
. But this seems highly dodgy as sudo apt-get install upstart
changes your LXDE
theme for some reason.