aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsysconfig/network-scripts/ifdown8
-rwxr-xr-xsysconfig/network-scripts/ifup5
-rw-r--r--sysconfig/network-scripts/network-functions11
3 files changed, 17 insertions, 7 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index c16f251f..6f1be524 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -5,6 +5,9 @@
cd /etc/sysconfig/network-scripts
. network-functions
+[ -f ../network ] && . ../network
+[ -f ../networking/network ] && . ../networking/network
+
CONFIG=$1
[ -z "$CONFIG" ] && {
@@ -21,8 +24,9 @@ need_config $CONFIG
if [ $UID != 0 ]; then
if [ -x /usr/sbin/usernetctl ]; then
- if /usr/sbin/usernetctl $CONFIG report ; then
- exec /usr/sbin/usernetctl $CONFIG down
+ source_config
+ if /usr/sbin/usernetctl ${DEVICE} report ; then
+ exec /usr/sbin/usernetctl ${DEVICE} down
fi
fi
echo $"Users cannot control this device." >&2
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 73e4e805..3a3e4316 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -34,8 +34,9 @@ need_config ${CONFIG}
if [ ${UID} != 0 ]; then
if [ -x /usr/sbin/usernetctl ]; then
- if /usr/sbin/usernetctl ${CONFIG} report ; then
- exec /usr/sbin/usernetctl ${CONFIG} up
+ source_config
+ if /usr/sbin/usernetctl ${DEVICE} report ; then
+ exec /usr/sbin/usernetctl ${DEVICE} up
fi
fi
echo $"Users cannot control this device." >&2
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index d3cf86ef..d6deb549 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -9,9 +9,14 @@ export PATH
need_config ()
{
- [ -f "${CONFIG}" ] || CONFIG=../networking/default/${1}
- [ -f "${CONFIG}" ] || CONFIG=../networking/default/ifcfg-${1}
- [ -f "${CONFIG}" ] || CONFIG="ifcfg-${1}"
+ CURRENT_PROFILE=${CURRENT_PROFILE:-default}
+ CURRENT_PROFILE=${CURRENT_PROFILE##*/}
+ CONFIG=../networking/profiles/$CURRENT_PROFILE/ifcfg-${1}
+ [ -f "${CONFIG}" ] && return || CONFIG=../networking/profiles/$CURRENT_PROFILE/${1}
+ [ -f "${CONFIG}" ] && return || CONFIG=../networking/default/ifcfg-${1}
+ [ -f "${CONFIG}" ] && return || CONFIG=../networking/default/${1}
+ [ -f "${CONFIG}" ] && return || CONFIG="ifcfg-${1}"
+ [ -f "${CONFIG}" ] && return || CONFIG="${1}"
}
source_config ()