ifup: minor code refactoring
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
parent
7963069c1e
commit
83dce52968
17
sbin/ifup
17
sbin/ifup
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Copyright (c) 2003-2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
# 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
|
. /etc/sysconfig/rc
|
||||||
. $rc_functions
|
. $rc_functions
|
||||||
@ -15,11 +15,16 @@ DEVICE=${1}
|
|||||||
|
|
||||||
[ "$NM_CONTROLLED" = "no" ] || exit 0
|
[ "$NM_CONTROLLED" = "no" ] || exit 0
|
||||||
|
|
||||||
[ "$2" = "--udev" -a "$ONBOOT" != "yes" -a "$ONBOOT" != "1" -a "$ONBOOT" != "true" ] \
|
if [ "$2" = "--udev" ]; then
|
||||||
&& exit 0
|
case "$ONBOOT" in
|
||||||
|
yes|true|1)
|
||||||
# udev boot: exit if root filesystem is read only
|
# udev boot: exit if root filesystem is read only
|
||||||
[ "$2" = "--udev" -a ! -w /var/run ] && exit 0
|
[ -w /var/run ] || exit 0
|
||||||
|
;;
|
||||||
|
*) exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -x $network_devices/ifup-${DEVICE} ]; then
|
if [ -x $network_devices/ifup-${DEVICE} ]; then
|
||||||
$network_devices/ifup-${DEVICE}
|
$network_devices/ifup-${DEVICE}
|
||||||
|
Loading…
Reference in New Issue
Block a user