Hoe kun je in Linux ook weer gemakkelijk van een interface het IP-adres in een scriptje krijgen. Gewoon bash of perl of iets anders zolang het maar gewoon van shell commandos gebruik maakt
<BLOCKQUOTE><font size=1 face=Verdana, Arial, Helvetica>code:</font><HR>/sbin/ifconfig eth0 | grep inet | cut -d : -f 2 | cut -d \ -f 1[/quote]
Those who do not understand Unix are condemned to reinvent it, poorly.
#!/bin/sh
EXTIF="ppp0"
/sbin/ifconfig | grep -A 4 $EXTIF | awk '/inet/ { print $2 } ' | sed -e s/addr://
EXTIF="ppp0"
/sbin/ifconfig | grep -A 4 $EXTIF | awk '/inet/ { print $2 } ' | sed -e s/addr://