Advertisement
Guest User

autostart script

a guest
Apr 19th, 2014
529
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. ### BEGIN INIT INFO
  2. # Provides: picam
  3. # Required-Start: $remote_fs $syslog
  4. # Required-Stop: $remote_fs $syslog
  5. # Default-Start: 2 3 4 5
  6. # Default-Stop: 0 1 6
  7. # Short-Description: picam
  8. # Description: picam
  9. ### END INIT INFO
  10.  
  11.  
  12. #! /bin/sh
  13. # /etc/init.d/picam
  14.  
  15.  
  16. export HOME
  17. case "$1" in
  18. start)
  19. echo "Starting picam"
  20. /home/pi/picam.py 2>&1 &
  21. ;;
  22. stop)
  23. echo "Stopping picam"
  24. CAM_PID=`ps auxwww | grep picam.py | grep -v grep | head -1 | awk '{print $2}'`
  25. kill -9 $CAM_PID
  26. ;;
  27. *)
  28. echo "Usage: /etc/init.d/picam {start|stop}"
  29. exit 1
  30. ;;
  31. esac
  32. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement