#! /bin/sh # /etc/init.d/lcd0 # # 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" sudo kill -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