[Buildroot] [PATCH 2/2] package/busybox: add init script for sysctl

Carlos Santos casantos at datacom.com.br
Tue Dec 18 17:19:49 UTC 2018


> From: "Nicolas Cavallari" <Nicolas.Cavallari at green-communications.fr>
> To: "Carlos Santos" <casantos at datacom.com.br>, "buildroot" <buildroot at buildroot.org>
> Cc: "ratbert90" <aduskett at gmail.com>, "DATACOM" <rodrigo.rebello at datacom.com.br>
> Sent: Terça-feira, 18 de dezembro de 2018 14:32:18
> Subject: Re: [Buildroot] [PATCH 2/2] package/busybox: add init script for sysctl

> On 18/12/2018 06:02, Carlos Santos wrote:
>> +	find $SYSCTL_SOURCES -maxdepth 1 -name '*.conf' -print0 2> /dev/null | \
>> +	xargs -0 -r readlink -f | \
>> +	{
>> +		read -r file
>> +		[ -z "$file" ] || /sbin/sysctl -q -p "$file" $SYSCTL_ARGS || return 1
>> +	}
> 
> So it will only read the first file it finds ?

The "||" operator means "do the RHS if the LHS is false", so if "$file"
is empty it doesn't run sysctl; otherwise if syscl fails (which currently
never happens due to a bug in Busybox) it returns from the function.

-- 
Carlos Santos (Casantos) - DATACOM, P&D
“Marched towards the enemy, spear upright, armed with the certainty
that only the ignorant can have.” — Epitaph of a volunteer


More information about the buildroot mailing list