#! /bin/bash
### BEGIN INIT INFO
# Provides: LED
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 1 6
# Short-Description: Stops LED blinking on S100
### END INIT INFO
# Defaults
RUN_MODE="daemons"
#/bin/stty 38400 cs8 -parenb -cstopb < /dev/ttyS1 > /dev/ttyS1
#echo -e 'xa2xb2xa2xb2xa2xb2' > /dev/ttyS1
case "$1" in
start)
#grünes Blinken abschalten
/bin/stty 38400 cs8 -parenb -cstopb -F /dev/ttyS1
ls -l /dev/ttyS1
echo -e '\xa2\xb2\xa2\xb2\xa2\xb2' > /dev/ttyS1
# modprobe i2c-i810
;;
stop)
# This will simulate a press of the power button (red blinking, poweroff)
/bin/sync
modprobe -r i2c-i810
/bin/sync
/bin/stty 38400 cs8 -parenb -cstopb -F /dev/ttyS1
echo -e "\xa2\xb1\xa2\xb1\xa2\xb1" > /dev/ttyS1
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0