@naitreia you can create the custom.sh
file in /recalbox/share/system/
like this :
| #!/bin/sh |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| start() { |
| echo -n "Starting opto: " |
| |
| echo "18" > /sys/class/gpio/export |
| echo "out" > /sys/class/gpio/gpio18/direction |
| |
| echo "1" > /sys/class/gpio/gpio18/value |
| echo "OK" |
| } |
| |
| stop() { |
| echo -n "Stopping opto: " |
| |
| echo "18" > /sys/class/gpio/export |
| echo "out" > /sys/class/gpio/gpio18/direction |
| |
| echo "0" > /sys/class/gpio/gpio18/value |
| |
| echo "18" > /sys/class/gpio/unexport |
| echo "OK" |
| } |
| |
| case "$1" in |
| start) |
| start |
| ;; |
| stop) |
| stop |
| ;; |
| restart|reload) |
| stop |
| start |
| ;; |
| *) |
| echo "Usage: $0 {start|stop|restart}" |
| exit 1 |
| esac |
| |
| exit $? |
don't forget
chmod 755 custom.sh
You can try to use it with
/etc/init.d/S99custom start
you should get
| # /etc/init.d/S99custom start |
| Starting opto: OK |