I’ve got a Raspberry Pi with connected camera. When the Pi boots up there should be executed a script which starts the camera software.

You must create an new file in /etc/init.d/ and then add the following content:

# /etc/init.d/startcam

# Carry out specific functions when asked to by the system
case "$1" in
  start)
    /home/pi/start.sh
    ;;
  stop)
    pkill webcam
    echo "stopped"
    ;;
  *)
    echo "Usage: /etc/init.d/startcam {start|stop}"
    exit 1
    ;;
esac

exit 0

then make the file executeable

sudo chmod +x /etc/init.d/startcam

to test your script, you must be shure that it isn’t active

ps -ef | grep webcam

then start the script using

sudo /etc/init.d/startcam start

or just reboot your computer and check once again if your script is active.

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +2 (from 2 votes)
Automatic execute on startup :: Debian Linux (Raspberry Pi), 5.0 out of 5 based on 1 rating

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.