Hi again
----- Mail original ----- > De: "Catalin Patulea" <[email protected]> > À: "OpenWrt Development List" <[email protected]> > Envoyé: Vendredi 3 Janvier 2014 19:43:54 > Objet: Re: [OpenWrt-Devel] [PATCH v3] Add sysfixtime init script, replacement > of luci_fixtime > > On Jan 3, 2014 1:29 PM, "Etienne CHAMPETIER" < > [email protected] > wrote: > > > > + > > +boot() { > > + CURTIME=`date +%s` > > + MAXTIME=`find /etc -type f -exec date +%s -r {} \; | sort | tail > > -n1` > Also 'sort -r | head -n1' would save a small amount of work. What really take time is the find part (0.65s) where sort (-n/-r/-nr) (0.01s) and tail/head (0.01s) doesn't really take time I'll put it anyway, thanks > > > + [[ $CURTIME -lt $MAXTIME ]] && \ > > + date -s @$MAXTIME && \ > > + /usr/bin/logger -t sysfixtime -p daemon.notice "Time fixed" > > +} _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
