Files
Samuele E. Locatelli 250b0c5432 Update sw x IOB-PI
2020-07-16 17:24:55 +02:00

42 lines
1.0 KiB
Bash

#! /bin/bash
### BEGIN INIT INFO
# Provides: MapoIOB: script Steamware per avvio driver IOB
# Required-Start: $remote_fs $syslog ramlog
# Required-Stop: $remote_fs $syslog ramlog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Steamware's MapoIOB driver
# Description: Steamware's MapoIOB driver, versione lettura porta parallela
### END INIT INFO
# /etc/init.d/MapoIOB
export HOME
case "$1" in
start)
echo "Starting readParallela"
cd /home/pi/steamware
/usr/bin/python ./readParallela.py 2>&1 &
;;
stop)
echo "Stopping readParallela"
RS_PID=`ps auxwww | grep readParallela.py | head -1 | awk '{print $2}'`
kill -9 $RS_PID
cd /home/pi/steamware
rm .lockfile
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
killall python
$0 start
;;
*)
echo "Usage: /etc/init.d/MapoIOB {start|stop|restart}"
exit 1
;;
esac
exit 0