Python im Autostart

23. März 2013 at 08:14
Print Friendly, PDF & Email

Shell script unter /etc/init.d/ speichern und mit chmod +x ausführbar machen, dann in den Autostart:

> nano <name>.sh
> chmod +x <name>.sh
&gt; update-rc.d <code>&lt;name&gt;.sh

defaults

 

<code>#! /bin/sh
### BEGIN INIT INFO
# Provides:
# Required-Start:
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description:

# Aktionen
 case "$1" in
 start)
 echo "Starte Lueftersteuerung..."
 nice -1 /usr/bin/python /home/luefterscript/schalten.py &
 ;;
 stop)
 echo "Lueftersteuerung wird beendet....."
 killall python
 ;;
 esac
 exit 0