Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # /usr/bin/env bash
- ### BEGIN INIT INFO
- # Provides: monitoring-py.sh
- # Required-Start:
- # Required-Stop:
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: Start daemon at boot time
- # Description: Enable service provided by daemon.
- ### END INIT INFO
- # Set up environment
- PATH=$(sudo -Hiu Pi env | grep PATH | cut -c 6-)
- PWD=/home/pi/Desktop/VL53L0X/python
- case "$1" in
- start)
- # Start
- cd $PWD && python Program.py
- echo "Starting monitor-py"
- ;;
- stop)
- # Stop
- echo "Stopping monitor-py"
- ;;
- restart)
- # Restart
- echo "Restarting monitor-py"
- ;;
- *)
- # Else
- echo "(start|stop|restart)"
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement