From 83dce529680475df650ecb0f2ca590e4a5a5af09 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Thu, 21 Feb 2013 21:20:19 +0100 Subject: [PATCH] ifup: minor code refactoring Signed-off-by: Davide Madrisan --- sbin/ifup | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sbin/ifup b/sbin/ifup index ecbcad8..c71a3b8 100644 --- a/sbin/ifup +++ b/sbin/ifup @@ -1,6 +1,6 @@ #!/bin/bash # Copyright (c) 2003-2012 by Silvan Calarco -# Copyright (c) 2003-2009 by Davide Madrisan +# Copyright (c) 2003-2009,2013 by Davide Madrisan . /etc/sysconfig/rc . $rc_functions @@ -15,11 +15,16 @@ DEVICE=${1} [ "$NM_CONTROLLED" = "no" ] || exit 0 -[ "$2" = "--udev" -a "$ONBOOT" != "yes" -a "$ONBOOT" != "1" -a "$ONBOOT" != "true" ] \ - && exit 0 - -# udev boot: exit if root filesystem is read only -[ "$2" = "--udev" -a ! -w /var/run ] && exit 0 +if [ "$2" = "--udev" ]; then + case "$ONBOOT" in + yes|true|1) + # udev boot: exit if root filesystem is read only + [ -w /var/run ] || exit 0 + ;; + *) exit 0 + ;; + esac +fi if [ -x $network_devices/ifup-${DEVICE} ]; then $network_devices/ifup-${DEVICE}