ifup: minor code refactoring

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2013-02-21 21:20:19 +01:00
parent 7963069c1e
commit 83dce52968

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2003-2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (c) 2003-2009 by Davide Madrisan <davide.madrisan@gmail.com>
# Copyright (c) 2003-2009,2013 by Davide Madrisan <davide.madrisan@gmail.com>
. /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}