Hi

----- Mail original -----
> De: "Andreas Mohr" <[email protected]>
> À: [email protected]
> Cc: "Etienne CHAMPETIER" <[email protected]>
> Envoyé: Vendredi 3 Janvier 2014 22:30:55
> Objet: Re: [PATCH v4] Add sysfixtime init script, replacement of luci_fixtime
> 
> Hi,
> 
> On Fri, Jan 03, 2014 at 10:10:42PM +0100,
> [email protected] wrote:
> > From: Etienne CHAMPETIER <[email protected]>
> > +#!/bin/sh /etc/rc.common
> ^^^^^^^^^^^^^^
> 
> > +# Copyright (C) 2013-2014 OpenWrt.org
> > +
> > +START=00
> > +
> > +boot() {
> > +   CURTIME=`date +%s`
> > +   MAXTIME=`find /etc -type f -exec date +%s -r {} \; | sort -nr |
> > head -n1`
> > +   [[ $CURTIME -lt $MAXTIME ]] && \
> 
> Ain't that a bashism?

Yes, but it's working (TM) :)
openwrt uses ash, and modern sh support [[
 
> Most likely ought to be [ cond ] && ...
> 
> OK, Debian checkbashisms does flag that:
> 
> $ checkbashisms /tmp/test1.sh
> possible bashism in /tmp/test1.sh line 11 (alternative test command
> ([[
> foo ]] should be [ foo ])):
>      [[ $CURTIME -lt $MAXTIME ]] && \
>              date -s @$MAXTIME && \
>              /usr/bin/logger -t sysfixtime -p daemon.notice "Time
>              fixed"
> 
> 
> Polite excuse for the oh so usual "bzzzzt"-type mail implicitly
> included ;)
> 
> Thanks for this very nice puzzle piece,
> 
> Andreas Mohr
> 
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to