#!/bin/bash # /etc/init.d/autorun ### BEGIN INIT INFO # Provides: autorun # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Example initscript # Description: This service is used to manage a servo ### END INIT INFO case "$1" in start) echo "Starting autorun" #/home/pi/servoblaster/PiBits/ServoBlaster/user/servod echo "rrrr1" > /home/pi/hello.txt #sudo bash ./home/pi/autorun sudo python /home/pi/simple.py sudo python /home/pi/Documents/pymodbus/examples/common/test.py #echo "ggg" > /home/pi/hello.txt ;; stop) echo "Stopping autorun" killall autorun ;; *) echo "Usage: /etc/init.d/autorun start|stop" exit 1 ;; esac exit 0