base-files: derive lease_acquired dhcp state var from /proc/uptime
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 10 Feb 2011 20:05:05 +0000 (20:05 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 10 Feb 2011 20:05:05 +0000 (20:05 +0000)
SVN-Revision: 25452

package/base-files/files/usr/share/udhcpc/default.script

index b614c45865b3ecd7f3ab0973e8b649b01bb2c19a..8dbff4747540c9b82339e52ba65c8431244ae712 100755 (executable)
@@ -103,7 +103,7 @@ setup_interface () {
 
        # UCI State
        change_state network "$ifc" lease_server "$serverid"
-       change_state network "$ifc" lease_acquired "$(date '+%s')"
+       change_state network "$ifc" lease_acquired "$(sed -ne 's![^0-9].*$!!p' /proc/uptime)"
        change_state network "$ifc" lease_lifetime "$lease"
        [ -n "$ntpsrv" ] &&     change_state network "$ifc" lease_ntpsrv "$ntpsrv"
        [ -n "$timesvr" ] &&    change_state network "$ifc" lease_timesrv "$timesvr"