From d2656b7dab538dcb7b5e49c6ac4aa5833a883a8c Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Thu, 14 Jun 2012 17:09:42 +0200 Subject: Less forking Suggestion by Dave Reisner. --- src/network | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/network b/src/network index 4858144..e8c2ae1 100644 --- a/src/network +++ b/src/network @@ -364,7 +364,8 @@ is_interface() { } interface_is_up() { - local flags="$(< "/sys/class/net/$1/flags")" + local flags + read flags < "/sys/class/net/$1/flags" # IFF_UP is defined as 0x1 in linux/if.h (( flags & 0x1 )) } -- cgit v1.2.3-24-g4f1b