|
|
712866 |
From b4b60da8dcdd6bc6f1e66ece90e1070b07db0cf4 Mon Sep 17 00:00:00 2001
|
|
|
712866 |
From: Harald Hoyer <harald@redhat.com>
|
|
|
712866 |
Date: Thu, 30 Jan 2014 13:50:02 +0100
|
|
|
712866 |
Subject: [PATCH] network: understand ip=.....:<dns1>:<dns2>
|
|
|
712866 |
|
|
|
712866 |
---
|
|
|
712866 |
modules.d/40network/net-lib.sh | 23 +++++++++++++++++------
|
|
|
712866 |
1 file changed, 17 insertions(+), 6 deletions(-)
|
|
|
712866 |
|
|
|
712866 |
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
|
|
|
712866 |
index 7544401..36fad12 100755
|
|
|
712866 |
--- a/modules.d/40network/net-lib.sh
|
|
|
712866 |
+++ b/modules.d/40network/net-lib.sh
|
|
|
712866 |
@@ -339,7 +339,7 @@ ip_to_var() {
|
|
|
712866 |
fi
|
|
|
712866 |
done
|
|
|
712866 |
|
|
|
712866 |
- unset ip srv gw mask hostname dev autoconf macaddr mtu
|
|
|
712866 |
+ unset ip srv gw mask hostname dev autoconf macaddr mtu dns1 dns2
|
|
|
712866 |
case $# in
|
|
|
712866 |
0) autoconf="error" ;;
|
|
|
712866 |
1) autoconf=$1 ;;
|
|
|
712866 |
@@ -347,11 +347,22 @@ ip_to_var() {
|
|
|
712866 |
3) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2; [ -n "$3" ] && mtu=$3 ;;
|
|
|
712866 |
4) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2; [ -n "$3" ] && mtu=$3; [ -n "$4" ] && macaddr=$4 ;;
|
|
|
712866 |
*) [ -n "$1" ] && ip=$1; [ -n "$2" ] && srv=$2; [ -n "$3" ] && gw=$3; [ -n "$4" ] && mask=$4;
|
|
|
712866 |
- [ -n "$5" ] && hostname=$5; [ -n "$6" ] && dev=$6; [ -n "$7" ] && autoconf=$7; [ -n "$8" ] && mtu=$8;
|
|
|
712866 |
- if [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
|
|
|
712866 |
- macaddr="${9}:${10}:${11}:${12}:${13}:${14}"
|
|
|
712866 |
- fi
|
|
|
712866 |
- ;;
|
|
|
712866 |
+ [ -n "$5" ] && hostname=$5; [ -n "$6" ] && dev=$6; [ -n "$7" ] && autoconf=$7;
|
|
|
712866 |
+ case "$8" in
|
|
|
712866 |
+ [0-9]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
|
|
|
712866 |
+ dns1="$mtu"; unset $mtu
|
|
|
712866 |
+ [ -n "$9" ] && dns2="$9"
|
|
|
712866 |
+ ;;
|
|
|
712866 |
+ [0-9]*)
|
|
|
712866 |
+ mtu="$8"
|
|
|
712866 |
+ ;;
|
|
|
712866 |
+ *)
|
|
|
712866 |
+ if [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
|
|
|
712866 |
+ macaddr="${9}:${10}:${11}:${12}:${13}:${14}"
|
|
|
712866 |
+ fi
|
|
|
712866 |
+ ;;
|
|
|
712866 |
+ esac
|
|
|
712866 |
+ ;;
|
|
|
712866 |
esac
|
|
|
712866 |
|
|
|
712866 |
# ip=<ipv4-address> means anaconda-style static config argument cluster:
|