lkml.org 
[lkml]   [1996]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Pre-release 2.0.5 breaks network config scripts
Date
In article <4nqddo$ahm@flint.inr.ac.ru>,
really kuznet@ms2.inr.ac.ru <inr-linux-kernel@ms2.inr.ac.ru> wrote:
>Herbert Rosmanith (herp@wildsau.idv.uni-linz.ac.AT) wrote:
>: > Can we at least put a patch into route to strip the host portion. This is
>: > the way I use route. I want say: route the net for which this host
>: > address is valid. In this way, a simple shell scripts can say:
>: >
>: > echo -n "Enter IP"
>: > read ip
>: > ifconfig eth0 $ip
>: > route add -net $ip
>
>: how about this patch:
>
>: - route add -net $ip
>: + route add -host $ip
>
>Incorrect. "route add -host $ip" will not add route to your
>ethernet network.

Ah, a shell script programming contest thread ;) How about:

echo -n "Enter IP"
read ip
ifconfig eth0 $ip
route add -net ${ip%.*}.0

The ${x% and ${x# stuff is very flexible..

Mike.
--
+ Miquel van Smoorenburg + Cistron Internet Services + Living is a |
| miquels@cistron.nl (SP6) | Independent Dutch ISP | horizontal |
+ miquels@drinkel.ow.org + http://www.cistron.nl/ + fall +



\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.057 / U:0.928 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site