Re: /etc/init.d/network is too simple?
On Fri, 16 Apr 1999, Victor B Wagner wrote:
You should probably do as well:
if [ -f /proc/net/dev ]
then
if [ "`grep '^ $interface' /proc/net/dev`" -ne "" ]
then
ifconfig ...
fi
fi
> Reallty there should be separate files, perhaps in /etc/network
> which consist solely of variable definitions:
> say:
>
> /etc/network/eth1
> IPADDR=192.168.217.1
> NETMASK=255.255.255.0
> NETWORK=
> BROADCAST=
>
> and base script should contain something like
> echo -n "configuring network interfaces "
> for i in /etc/network/*; do
> interface=`basename $i`
> source $i
> echo "$interface "
> ifconfig $interface $IPADDR netmask $NETMASK
> route add -net ${NETWORK}
> done
> echo ""
>
> Possibly, there should be separtate script to configure network interfaces
> say /sbin/netconfig
> and /etc/init.d/network
> should contain only
> case $1 of
> start)
> for $i in `ls /etc/network` ; do
> /sbin/netconfig $i up
> done
> ;;
> stop)
> for $i in `ls /etc/network` ; do
> /sbin/netconfig $i down
> done
> ;;
> esac
> --------------------------------------------------
> Victor Wagner vitus@ice.ru
> Programmer Office:7-(095)-964-0380
> Institute for Commerce Home: 7-(095)-135-46-61
> Engineering http://www.ice.ru/~vitus
>
+---------------------------------+-------------------------------------+
| R Garth Wood | Making waves... |
| Stormix Technologies Inc. | |
| rgwood@stormix.com | |
Reply to: