Where to place autostart.sh or other way

I’m newbie to OSMC and I want ask following:
Long time I used openelec, where I copied into “/storage/.config/” file autostart.sh with following text

#   Exports pin to userspace
echo "17" > /sys/class/gpio/export                  

# Sets pin 17 as an output
echo "out" > /sys/class/gpio/gpio17/direction

# Sets pin 17 to high
echo "1" > /sys/class/gpio/gpio17/value

but where to copy in OSMC or where place text from autostart.sh ?
Thank you for your help


Hi Alex,

Can probably achieve this with rc,local or a systemd service file, Sam has put a guide on the wiki; it can be found here.

Thanks Tom.

Hi, thank you, but rc.local I can’t modify, no permision (I’m logged via winscp as root).
I also checked wiki, but I can’t understand where copy my file or where to place.

Use sudo to edit the file.

Details regarding how to access the command line interface can be found here on our Wiki: Accessing the command line - General - OSMC


You’ll probably find it easier using the command-line.

If you going to use rc.local, to edit it:

sudo nano /etc/rc.local

Add path to script as described in the guide, ctrl-x to exit and yes to save.

I’d place your script, as the guide suggests:


Thanks Tom.

No luck create a directory :

  login as: osmc
    osmc@'s password:

    The programs included with the Debian GNU/Linux system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.

    Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
    permitted by applicable law.
    Last login: Wed Jul  5 21:52:58 2017 from
    Updating APT cache. Please be patient.
    apt-get update was unsuccessful. If you are planning to install a package, please run apt-get update first and verify it was successful
    osmc@osmc:~$ cd /home/osmc
    osmc@osmc:~$ mkdir scripts
    mkdir: cannot create directory 'scripts': No space left on device


Looks like you may need a new sdcard.

You are out of space.

Did you install via NOOBS? If you plan to use only OSMC install from Download - OSMC.


Finally I was able do it as is in the wiki. I also used bigger sdcard.
Install I did from downloaded image.
What I like is that osmc is much faster then openelec.

Problem is solved,please close.