Installing my own shell script - which memory location?

I would like to install my own script (.sh) on my Netgear R7800 (OpenWRT 21.02.2). Is there a recommended area of memory that I should install it to? I've used NVRAM on another OS, but I did not see any OpenWRT pkgs for NVRAM on the R7800. I'm new to OpenWRT and advice or links are appreciated. Thanks.

Don't do it in tmpfs mount | grep tmp and add the location in backup , e.g

echo "/root/bin" >> /etc/sysupgrade.conf

Ok. Thanks.

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

I have this question too. I have a r7800 and I just put it in /etc/config/. of course I did chmod +x /etc/config/myscript.

is /etc/config an ok place to put my scripts?

Not really.
Those files may cause uci errors, if/when those files are parsed like normal uci config files.

/bin or /usr/bin would be better.
(Personally I keep a few scripts in /etc )
It makes no real difference.

From backup perspective, all my scripts are baked to the firmware image itself, so there is no need to seperately take care of nay backups.

If the scripts have been added manually, then follow trendy's advice above.

They are manually added. I want more info on baking my scripts into my firmware image, specifically my i915 power management but thanks for the advice.

There is an "accepted convention" where things go in a Linux system, the Filesystem Hierarchy Standard. It would suggest that scripts (considered "binaries") that belong to a user and are specific to this host would go into /usr/local/bin

That being said, this is probably a topic on which you can get ten different opinions from nine people. In the end it's your system, do however you please.

easy to do as "custom files"...

Thanks. I'm technically not the author but this does answer the question if you build your own firmware and I do.

I'm glad this was left open for a little while. I learned more about this. I can mark it solved.

Thanks to and solved by trendy, kufkis, hnyman, and takimata.

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