This commit is contained in:
Jephté Clain 2014-01-28 07:49:33 +04:00
parent 445bbe90ff
commit ac46456273
1 changed files with 5 additions and 5 deletions

View File

@ -318,24 +318,24 @@ function __network_set_mainip() {
# des adresses actuelles, principale et supplémentaire
eval "$(ip addr show dev "$1" | awk "BEGIN {
mainipvar = \"${2:-mainip}\"
netmaskvar = \"${3:-netmask}\"
suffixvar = \"${3:-suffix}\"
broadcastvar = \"${4:-broadcast}\"
"'
print mainipvar "="
print netmaskvar "="
print suffixvar "="
print broadcastvar "="
}
$1 == "inet" {
mainip = ""; netmask = ""; broadcast = ""
mainip = ""; suffix = ""; broadcast = ""
if (match($0, "inet ([^ ]*)/([^ ]*) ", vs) != 0) {
mainip = vs[1]
netmask = vs[2]
suffix = vs[2]
}
if (match($0, "brd ([^ ]*) ", vs) != 0) {
broadcast = vs[1]
}
print mainipvar "=\"" mainip "\""
print netmaskvar "=\"" netmask "\""
print suffixvar "=\"" suffix "\""
print broadcastvar "=\"" broadcast "\""
exit 0
}')"