(resolved) Execute code at startup automatically

Hi,

How can I have some code we created to be executed automatically after startup (not as service).

Thanks in advance.

Your best bet would be to add your command to the /etc/rc.local file. This file is processed last after boot.

Example /etc/rc.local file:

#!/bin/sh -e

/DietPi/dietpi/dietpi-services start

#My message
echo -e "This will be displayed during boot"

#create a file
echo -e "My test file" > /root/testfile

exit 0