will give you the IP associated with eth0 (dynamic or static)
so, you can use:
EXT_IP=`ifconfig eth0 | grep 'inet addr' | cut -d: -f2 | cut -d' ' -f1`
__
Actually, my internet connection is dialled only after Linux has fully booted up and i have login as root. Therefore the dynamic IP is only available after the login. My firewall however, is launched during boot time. Is there any other way that I can do this? Or do I have to execute the firewall script everytime i change my IP?
On my Mandrake 9.0 box, there are some files in /etc/sysconfig/network-scripts. I'd look into 'ifup-ppp' if you are using dialup. Your distro may not have this exact file. Try doing a 'locate ifup', may get back some more relevant results. You just want to find any script that runs automagically after connection. In that script, have it call your rc.firewall.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.