Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
SMS Forum Index » General Discussion

Post new topic   Reply to topic
ifconfig - Warning about autodetecting the IP address
View previous topic :: View next topic  
Author Message
keopp
Senior Member


Joined: 08 Nov 2008
Posts: 166
Location: Romania

PostPosted: Sat Oct 19, 2013 4:31 pm    Post subject: ifconfig - Warning about autodetecting the IP address Reply with quote

Hello all,

Mostly inside the rc.firewall script I use to autodetect the NIC ip addresses by:
Code:

EXTIP="`$IFCONFIG $EXTIF | $GREP 'inet addr' | $AWK '{print $2}' | $SED -e 's/.*://'`"
## or
EXTIP="`$IFCONFIG $EXTIF | $AWK /$EXTIF/'{next}//{split($0,a,":");split(a[2],a," ");print a[1];exit}'`"


I've noticed after a fresh install of SMS64 2.0.5 that ifconfig has changed it's answer format.
A quick workaround is to use:
Code:

EXTIP="`$IFCONFIG $EXTIF | $GREP 'inet addr' | $AWK '{print $2}'`"


I have to mention that the basic firewall script I use, is rc.firewall-iptables-stronger ver 0.88s from tldp.org
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SMS Forum Index » General Discussion All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

SMS - Superb! Mini Server Project © 2016
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional