7915 questions

9343 answers

15048 comments

12858 members

0 votes
333 views 0 comments
by
Hello,

I would like to store in a persistent environment variable the current state of the relay DOUT2 (gpio.sh get DOUT2).

As I want to retrieve the value even after a reboot, I suppose that this variable shall be defined in /etc/profile.

But does the content of /etc/profile preserve during an upgrade of the firmware ? I suppose no.

I also suppose that I cannot declare /etc/profile in the /etc/sysupgrade.conf file because you could add variables in a new version.

Thenceforth where I could store this variable ?

Note that I am not a linux expert ...

Thank you by advance

1 Answer

0 votes
by

Hello,

Regarding the firmware update:

 - If firmware update would be done "without keeping any settings", all previous information in the router would be erased.

 - If firmware update would be done with "keep all settings", all information from the router would still be erased, apart from "/etc/config" directory (i.e. so that router would have new functionality, just with old configuration)

Therefore, in your case, it would be best to create your own file in "/etc/config" directory and store your desired information in this file.