Autostart.sh Proper Coding

I am trying to create an autostart.sh file that contains two different codes, what is the proper way to set it up? I keep getting a crash but ok when ran separately.

systemctl stop retroarch.service && DRAW_USE_LLVM=0 retroarch

and…

#!/bin/bash
(
while (sleep 8)
do
bluetoothctl << EOF
connect ADDRESS#
exit
EOF
done
) &

I’m pretty sure this won’t work in the autostart.sh script (DRAW_USE_LLVM=0 will be lost after the script finishes). The environment variable you are using should to be set system-wide.

In “full linux” this could be easily done (examples here), but in Lakka I don’t know if you can do this because of the read-only file system.

PS: have you considered just installing linux+retroarch?

The DRAW USE script does work… I have to use that code to boot into Lakka or else it never boots. So that definitely needs to be in autostart.sh

I’m basically trying to find the right syntax to get both scripts (DRAW USE and Bluetooth controller connect) to work in the autostart… or do I need to create a separate script for each?

New to Linux coding :slight_smile: Thanks!

What I am saying is that to fix your issue properly, the variable DRAW_USE_LLVM should be set globally. What you are currently doing is running retroarch from the script and not as a systemd service, as it should.

How do I go about doing that process as you speak of? I did wind up installing retroarch directly in windows for now - but would still like to figure this out. Thank you