Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37859245
en ru br
Репозитории ALT
S:5.17.0-alt2
5.1: 2.6.29-alt1
4.1: 2.6.23-alt2
4.0: 2.6.20.20070313-alt1
3.0: 2.4.7.20020116-alt5.1
www.altlinux.org/Changes

Группа :: Сети/Прочее
Пакет: iproute2

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: iproute2-2.4.7-alt-ifcfg.patch
Скачать


--- iproute2.orig/ip/ifcfg	2000-04-16 21:42:50 +0400
+++ iproute2/ip/ifcfg	2003-10-16 13:11:09 +0400
@@ -1,4 +1,6 @@
-#! /bin/bash
+#! /bin/sh
+
+export PATH="/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin"
 
 CheckForwarding () {
   local sbase fwd
@@ -22,17 +24,17 @@
   local class;
 
   class=${1%%.*}
-  if [ "$1" = "" -o $class -eq 0 -o $class -ge 224 ]; then return 0
-  elif [ $class -ge 224 ]; then return 0
-  elif [ $class -ge 192 ]; then return 24
-  elif [ $class -ge 128 ]; then return 16
+  if [ -z "$1" ] || [ "$class" -eq 0 -o "$class" -ge 224 ]; then return 0
+  elif [ "$class" -ge 224 ]; then return 0
+  elif [ "$class" -ge 192 ]; then return 24
+  elif [ "$class" -ge 128 ]; then return 16
   else return 8; fi
 }
 
 label="label $1"
 ldev="$1"
 dev=${1%:*}
-if [ "$dev" = "" -o "$1" = "help" ]; then
+if [ -z "$dev" -o "$1" = "help" ]; then
   echo "Usage: ifcfg DEV [[add|del [ADDR[/LEN]] [PEER] | stop]" 1>&2
   echo "       add - add new address" 1>&2
   echo "       del - delete address" 1>&2
@@ -66,12 +68,12 @@
 
 ipaddr=
 pfxlen=
-if [ "$1" != "" ]; then
+if [ -n "$1" ]; then
   ipaddr=${1%/*}
   if [ "$1" != "$ipaddr" ]; then
     pfxlen=${1#*/}
   fi
-  if [ "$ipaddr" = "" ]; then
+  if [ -z "$ipaddr" ]; then
     echo "$1 is bad IP address." 1>&2
     exit 1
   fi
@@ -79,21 +81,21 @@
 shift
 
 peer=$1
-if [ "$peer" != "" ]; then
-  if [ "$pfxlen" != "" -a "$pfxlen" != "32" ]; then
+if [ -n "$peer" ]; then
+  if [ -n "$pfxlen" -a "$pfxlen" != "32" ]; then
     echo "Peer address with non-trivial netmask." 1>&2
     exit 1
   fi
   pfx="$ipaddr peer $peer"
 else
-  if [ "$pfxlen" = "" ]; then
+  if [ -z "$pfxlen" ]; then
     ABCMaskLen $ipaddr
     pfxlen=$?
   fi
   pfx="$ipaddr/$pfxlen"
 fi
 
-if [ "$ldev" = "$dev" -a "$ipaddr" != "" ]; then
+if [ "$ldev" = "$dev" -a -n "$ipaddr" ]; then
   label=
 fi
 
@@ -108,7 +110,7 @@
   echo "Error: cannot enable interface $dev." 1>&2
   exit 1
 fi
-if [ "$ipaddr" = "" ]; then exit 0; fi
+if [ -z "$ipaddr" ]; then exit 0; fi
 
 if ! arping -q -c 2 -w 3 -D -I $dev $ipaddr ; then
   echo "Error: some host already uses address $ipaddr on $dev." 1>&2
@@ -127,14 +129,14 @@
 
 ip route add unreachable 224.0.0.0/24 >& /dev/null 
 ip route add unreachable 255.255.255.255 >& /dev/null
-if [ `ip link ls $dev | grep -c MULTICAST` -ge 1 ]; then
+if [ "`ip link ls $dev | grep -c MULTICAST`" -ge 1 ]; then
   ip route add 224.0.0.0/4 dev $dev scope global >& /dev/null
 fi
 
 if [ $fwd -eq 0 ]; then
   if [ $noarp -eq 0 ]; then
     ip ro append default dev $dev metric 30000 scope global
-  elif [ "$peer" != "" ]; then
+  elif [ -n "$peer" ]; then
     if ping -q -c 2 -w 4 $peer ; then
       ip ro append default via $peer dev $dev metric 30001
     fi
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin