diff options
author | Darren Austin <darren@slackware.uk> | 2018-05-24 01:16:26 -0500 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2018-05-24 01:23:40 -0500 |
commit | 05ad72a6c81027e977bc8566abf770cf0388899f (patch) | |
tree | 2d4a8eb344f5110de612af51a909c5558f1eec88 /rc.inet1 | |
parent | 38edd98bc9701f317c43fddafcbf2e808c969293 (diff) | |
download | slacknetsetup-current-20180531.tar.xz |
Fix up setting of IPALIASES and update docscurrent-20180531
Signed-off-by: Robby Workman <rworkman@slackware.com>
Diffstat (limited to 'rc.inet1')
-rw-r--r-- | rc.inet1 | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/bash # /etc/rc.d/rc.inet1 # This script is used to bring up the various network interfaces. # @@ -209,7 +209,10 @@ if_up() { # Add extra IP addresses, if defined, to interface num=0 for ipalias in ${IPALIASES[$i]}; do - /sbin/ip address add ${ipalias}/32 dev ${1} label ${1}:${num} ; + ip="${ipalias%/*}" + nm="${ipalias#*/}" + [ -z "$nm" ] || [ "$ip" == "$nm" ] && nm="32" + /sbin/ip address add ${ip}/${nm} dev ${1} label ${1}:${num} num=$(($num + 1)) done fi @@ -230,7 +233,10 @@ if_up() { if [ -n "${IPALIASES[$i]}" ]; then num=0 for ipalias in ${IPALIASES[$i]}; do - /sbin/ip address add ${ipalias}/32 dev ${1} label ${1}:${num} ; + ip="${ipalias%/*}" + nm="${ipalias#*/}" + [ -z "$nm" ] || [ "$ip" == "$nm" ] && nm="32" + /sbin/ip address add ${ip}/${nm} dev ${1} label ${1}:${num} num=$(($num + 1)) done fi |