[OpenWrt-Devel] How to check if its the first boot ever?

Ronaldo Afonso ronaldo at ronaldoafonso.com.br
Wed Jul 13 16:27:26 EDT 2016

  Hi all,

  I'm doing a customized OpenWrt firmware and I need to know at boot time
if its the first time my OpenWrt firmware has been booted.

  More specifically, my scripts at "/etc/uci-defaults" need to know if they
are being executed by flashing over a "router original firmware"
(factory.bin) or a previews OpenWrt firmware (sysupgrade.bin).

  For example:

  I need to set the network.lan.ipaddr to the IP address "" if
it is the first time I'm flashing my router, otherwise I need to preserve
the IP address the was configured before.

  Any help would be appreciated.

  Thanks in advance ...

Ronaldo Afonso
11 9 5252 0484
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20160713/40ea5d55/attachment.htm>
-------------- next part --------------
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list