Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. # /usr/bin/env bash
  2. ### BEGIN INIT INFO
  3. # Provides: monitoring-py.sh
  4. # Required-Start:
  5. # Required-Stop:
  6. # Default-Start: 2 3 4 5
  7. # Default-Stop: 0 1 6
  8. # Short-Description: Start daemon at boot time
  9. # Description: Enable service provided by daemon.
  10. ### END INIT INFO
  11.  
  12. # Set up environment
  13. PATH=$(sudo -Hiu Pi env | grep PATH | cut -c 6-)
  14. PWD=/home/pi/Desktop/VL53L0X/python
  15.  
  16. case "$1" in
  17. start)
  18. # Start
  19. cd $PWD && python Program.py
  20. echo "Starting monitor-py"
  21. ;;
  22.  
  23. stop)
  24. # Stop
  25. echo "Stopping monitor-py"
  26. ;;
  27.  
  28. restart)
  29. # Restart
  30. echo "Restarting monitor-py"
  31. ;;
  32. *)
  33. # Else
  34. echo "(start|stop|restart)"
  35. ;;
  36. esac
  37.  
  38. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement