#! /bin/sh # /etc/init.d/lcd0 # ### BEGIN INIT INFO # Provides: lcd0 # Required-Start: $local_fs $network # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: lcdscreen daemon # Description: lcd screen printing realtime data about the system ### END INIT INFO # Some things that run always #touch /var/lock/lcd0 script="/home/pi/code/lcdClock5.py" # Carry out specific functions when asked to by the system case "$1" in start) echo "Starting script lcd0 " sudo python $script & ;; stop) echo "Stopping script lcd0 with pid $PID" sudo kill -s 9 `ps -eo pid,cmd | grep "python $script" -m 2 | cut -d ' ' -f 1` ;; *) echo "Usage: /etc/init.d/blah {start|stop}" exit 1 ;; esac exit 0