All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] netplug (/etc/init.d/S29netplug): Fix the quoting of ${NETWORKING}.
@ 2018-11-15 13:48 Thomas Claveirole
  2018-11-20  7:57 ` Thomas Petazzoni
  2018-11-26 16:21 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Claveirole @ 2018-11-15 13:48 UTC (permalink / raw)
  To: buildroot

Since 4adaa581b27dc27298eb7cc421ee8f530f88e18e, S29netplug looks for
/etc/default/network instead of /etc/sysconfig/network.  When this
file exists but does not define $NETWORKING, the script fails on line
29 with something like:

/etc/init.d/S29netplug: 29: [: =: unexpected operator

Fix quoting so this error no longer happens.

Signed-off-by: Thomas Claveirole <thomas.claveirole@green-communications.fr>
---
 package/netplug/S29netplug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/netplug/S29netplug b/package/netplug/S29netplug
index 66459061b3..6c344662bb 100755
--- a/package/netplug/S29netplug
+++ b/package/netplug/S29netplug
@@ -26,7 +26,7 @@ if [ -f /etc/default/network ]; then
 	. /etc/default/network
 
 	# Check that networking is up.
-	[ ${NETWORKING} = "no" ] && exit 0
+	[ "$NETWORKING" = no ] && exit 0
 elif [ ! -f /etc/network/interfaces ]; then
 	# No network support
 	exit 0
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] netplug (/etc/init.d/S29netplug): Fix the quoting of ${NETWORKING}.
  2018-11-15 13:48 [Buildroot] [PATCH 1/1] netplug (/etc/init.d/S29netplug): Fix the quoting of ${NETWORKING} Thomas Claveirole
@ 2018-11-20  7:57 ` Thomas Petazzoni
  2018-11-26 16:21 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2018-11-20  7:57 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 15 Nov 2018 14:48:17 +0100, Thomas Claveirole wrote:
> Since 4adaa581b27dc27298eb7cc421ee8f530f88e18e, S29netplug looks for
> /etc/default/network instead of /etc/sysconfig/network.  When this
> file exists but does not define $NETWORKING, the script fails on line
> 29 with something like:
> 
> /etc/init.d/S29netplug: 29: [: =: unexpected operator
> 
> Fix quoting so this error no longer happens.
> 
> Signed-off-by: Thomas Claveirole <thomas.claveirole@green-communications.fr>
> ---
>  package/netplug/S29netplug | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/netplug/S29netplug b/package/netplug/S29netplug
> index 66459061b3..6c344662bb 100755
> --- a/package/netplug/S29netplug
> +++ b/package/netplug/S29netplug
> @@ -26,7 +26,7 @@ if [ -f /etc/default/network ]; then
>  	. /etc/default/network
>  
>  	# Check that networking is up.
> -	[ ${NETWORKING} = "no" ] && exit 0
> +	[ "$NETWORKING" = no ] && exit 0

I don't think it was really necessary to remove the double quotes
around "no", and to remove the curly braces to reference the variable.
So I've added those back, tweaked the commit title and applied to
master. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] netplug (/etc/init.d/S29netplug): Fix the quoting of ${NETWORKING}.
  2018-11-15 13:48 [Buildroot] [PATCH 1/1] netplug (/etc/init.d/S29netplug): Fix the quoting of ${NETWORKING} Thomas Claveirole
  2018-11-20  7:57 ` Thomas Petazzoni
@ 2018-11-26 16:21 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-11-26 16:21 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Claveirole <thomas.claveirole@green-communications.fr> writes:

 > Since 4adaa581b27dc27298eb7cc421ee8f530f88e18e, S29netplug looks for
 > /etc/default/network instead of /etc/sysconfig/network.  When this
 > file exists but does not define $NETWORKING, the script fails on line
 > 29 with something like:

 > /etc/init.d/S29netplug: 29: [: =: unexpected operator

 > Fix quoting so this error no longer happens.

 > Signed-off-by: Thomas Claveirole <thomas.claveirole@green-communications.fr>

Committed to 2018.02.x and 2018.08.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-26 16:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-15 13:48 [Buildroot] [PATCH 1/1] netplug (/etc/init.d/S29netplug): Fix the quoting of ${NETWORKING} Thomas Claveirole
2018-11-20  7:57 ` Thomas Petazzoni
2018-11-26 16:21 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.