summaryrefslogtreecommitdiffstats
path: root/rc.inet1
diff options
context:
space:
mode:
authorDarren Austin <darren@slackware.uk>2018-05-24 01:16:26 -0500
committerRobby Workman <rworkman@slackware.com>2018-05-24 01:23:40 -0500
commit05ad72a6c81027e977bc8566abf770cf0388899f (patch)
tree2d4a8eb344f5110de612af51a909c5558f1eec88 /rc.inet1
parent38edd98bc9701f317c43fddafcbf2e808c969293 (diff)
downloadslacknetsetup-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.inet112
1 files changed, 9 insertions, 3 deletions
diff --git a/rc.inet1 b/rc.inet1
index 1f3cb60..cf9da0f 100644
--- a/rc.inet1
+++ b/rc.inet1
@@ -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