Check the code for /sbin/console -- it does this for the GatewayIP value.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 3:01 PM To: [EMAIL PROTECTED] Subject: [e-smith-devinfo] more about {$LocalIP} Ok.. my perl skill really bites... what I need is help to be able to do the following (which I can do as a #!/bin/sh file...) I need to be able to take the variable, {$LocalIP} from /home/e- smith/configuration and manipulate it slightly so that the first 3 sets of numbers are outputed. In #!/bin/sh terms, what I'm trying to do is the following: (Assuming that {$LocalIP}=192.168.1.1 in the /etc/e-smith/configuration file) A=`cat $LocalIP | awk -F"." {'print $1'}` B=`cat $LocalIP | awk -F"." {'print $2'}` C=`cat $LocaLIP | awk -F"." {'print $3'}` echo $A"."$B"."$C".0/24" which would yield 192.168.1.0/24 I need this value passed to a .conf file when the template is expanded. What was there before was: var HOME_NET [127.0.0.1/32,{$LocalIP}/24,{$ExternalIP}/32] which is completely wrong... this is telling the conf file to use 192.168.1.1/24 as the range... (an illegal value?) and it should be 192.168.1.0 I hope I didn't confuse you as badly as I did myself here ;-) Anyway... any help as always, would be gratefully appreciated. Ari -- Please report bugs to [EMAIL PROTECTED] Please mail [EMAIL PROTECTED] (only) to discuss security issues Support for registered customers and partners to [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Archives by mail and http://www.mail-archive.com/devinfo%40lists.e-smith.org -- Please report bugs to [EMAIL PROTECTED] Please mail [EMAIL PROTECTED] (only) to discuss security issues Support for registered customers and partners to [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Archives by mail and http://www.mail-archive.com/devinfo%40lists.e-smith.org
