Custom led file gets missed

Openwrt 22.03.3.

I want to modify the /etc/rc.d/S96led file so I put mine in the files/etc/rc.d/ directory but each time I use image builder, it doesn't use my file, it uses the default.

How can I resolve this?

Place your modified file into files/etc/init.d/led


Hi, thanks for the reply.
Do you mean in a directory called led in init.d or just rename my S96led file to led and place it in init.d/

S96led in /etc/rc.d is just a symbolic link to the actual "led" file in /etc/init.d

If you edit the custom file files/etc/init.d/led, it will get copied to the firmware image, and the S96led in the image will point to it.

See the files from the live system below:

root@router5:~# ls -l /etc/rc.d/S96led
lrwxrwxrwx    1 root     root            13 May 15 19:44 /etc/rc.d/S96led -> ../init.d/led

root@router5:~# cat /etc/init.d/led
#!/bin/sh /etc/rc.common
# Copyright (C) 2008


load_led() {
        local name
        local sysfs
        local trigger
        local dev
        local ports
        local mode
        local default
        local delayon
        local delayoff
        local interval

        config_get sysfs $1 sysfs
        config_get name $1 name "$sysfs"

I'm sorry, you were too fast. I put a file called 'led' in the init.d directory as you said and it works perfectly so thank you very much for sharing that.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.