#
-# $Id: functions.network,v 1.25 1999/09/28 12:48:41 kloczek Exp $
+# $Id: functions.network,v 1.26 1999/09/28 14:02:41 kloczek Exp $
#
# This is not a shell script; it provides functions to network scripts
# that source it.
{
DEVNAME=`basename $CONFIG | sed 's/^ifcfg-//g'`
- if [ -f $CONFIG ] ; then
+ if [ -f /etc/sysconfig/interfaces/$CONFIG ] ; then
. /etc/sysconfig/interfaces/$CONFIG
elif [ "$USE_LDAP" = "yes" ] ; then
eval `get_ldap_config $DEVNAME`
prefix=0
olen=8
bad=0
-for i in $1 do len=0
+
+for i in $1; do
+ len=0
case $i in
255) len=8 ;;
254) len=7 ;;
else
typeset -i prefix=$1
fi
-for i in 1 2 3 4 do
+for i in 1 2 3 4; do
case $prefix in
7) a=254 ;;
6) a=252 ;;
esac
prefix="$(( $prefix - 8))"
- if [ -z "$MASK" ] then
+ if [ -z "$MASK" ]; then
MASK=$a
else
MASK=$MASK.$a