rpirena/www/etc/rc.local
stephan 7dc9bbd6b8 rpirena: cgi/rpirena-control
git-svn-id: svn+ssh://asterix.ieap.uni-kiel.de/home/subversion/stephan/solo/eda/cospi/host@7930 bc5caf13-1734-44f8-af43-603852e9ee25
2020-02-23 20:19:26 +00:00

30 lines
750 B
Bash
Executable file

#!/bin/sh -ev
#
# 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 %s\n" "$_IP"
fi
chmod g+rw /dev/spidev*
chgrp spi /dev/spidev*
cd ~stephan/rpirena || exit 0
[ -e auto-run ] || exit 0
killall -s 0 -r 'rpirena(-auto)?.py' && exit 0
mv data/rpirena-auto.log~ data/rpirena-auto.log~~ || true
mv data/rpirena-auto.log data/rpirena-auto.log~ || true
su stephan -c ./rpirena-auto.py >data/rpirena-auto.log 2>&1 &
exit 0