[OE-core] [PATCH v2] initscripts: fix timestamp check at bootmisc.sh

Phil Blundell philb at gnu.org
Tue Dec 13 13:07:04 UTC 2011


On Tue, 2011-12-13 at 14:58 +0200, Lauri Hintsala wrote:
> SYSTEMDATE=`date -u +%4Y%2m%2d`
> TIMESTAMP=`awk '{ print substr($0,9,4) substr($0,1,4); }' < /etc/timestamp`
> if [ $TIMESTAMP -gt $SYSTEMDATE ]; then
> 	read TIMESTAMP < /etc/timestamp
> 	date -u $TIMESTAMP
> 	/etc/init.d/hwclock.sh stop
> fi
> 
> How about this?

You could lose the call to "awk" as well:

read RAWTIMESTAMP < /etc/timestamp
TIMESTAMP=${RAWTIMESTAMP#????????}${RAWTIMESTAMP%????????}

Or, er, something like that.  You might need to tweak the patterns a bit
depending on what exactly the format of /etc/timestamp actually is, but
I guess you get the idea.

p.






More information about the Openembedded-core mailing list