OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › Starting ospi.py automatically › Re: Re: Starting ospi.py automatically
July 20, 2013 at 12:47 am
#24708
kkpwrh2o
Member
aradke, Thanks a bunch for your continued assistance. I appreciate it greatly.
Below is my rc.local file.
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %sn" "$_IP"
fi
host=$(hostname -I | sed 's/ *$//g')
port=:8080
cd /home/pi/OSPi/
## If you aren't sure that the path to python on your Pi is /usr/bin/, use $
/usr/bin/python ospi.py $host$port
exit 0