Code: Select all
proc get-nat-ip {} {
set f [open "|/sbin/ifconfig -a"]
while {![eof $f]} {lappend x [gets $f]}
close $f
foreach line $x {
if [string match "*inet *" $line] {
set ip [lindex [split [string trim $line]] 1]
if [string match 127.0.0.* $ip] continue
if [string match 192.168.* $ip] continue
return $ip
}
}
}
Code: Select all
set nat-ip [get-nat-ip]
it doesn't seem like the script work right.. what could be wrong ? It's the same if i have it like a seperate script or in the config-file..[16:19] Telnet connection: 2mmy.pointclark.net/4525
[16:20] Challenging s0tt0s...
[16:20] Linked to s0tt0s.
*** Linked to s0tt0s
[16:20] Creating resync buffer for s0tt0s
[16:20] Sending user file send request to s0tt0s
[16:20] Ending sharing with s0tt0s (Can't connect to you!).
[16:20] (Userlist transmit aborted.)
[16:20] Lost bot: s0tt0s (lost 1 bot and 0 users).
*** Lost bot: s0tt0s (lost 1 bot and 0 users)
[s0tnos@s0tnos s0tnos]$ /sbin/ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:02:B3:9E:B5:04
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18006421 errors:5 dropped:0 overruns:0 frame:5
TX packets:16971362 errors:45 dropped:0 overruns:0 carrier:45
collisions:20737 txqueuelen:100
RX bytes:2859060663 (2726.6 Mb) TX bytes:3390224294 (3233.1 Mb)
Interrupt:11 Base address:0xd800 Memory:dffff000-dffff038
eth1 Link encap:Ethernet HWaddr 00:04:75:FB:46:D9
inet addr:192.168.123.1 Bcast:192.168.123.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5788301 errors:0 dropped:0 overruns:0 frame:0
TX packets:6006514 errors:0 dropped:0 overruns:0 carrier:9049
collisions:0 txqueuelen:100
RX bytes:2931630945 (2795.8 Mb) TX bytes:4254833775 (4057.7 Mb)
Interrupt:12 Base address:0xd400
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:263388 errors:0 dropped:0 overruns:0 frame:0
TX packets:263388 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:25192007 (24.0 Mb) TX bytes:25192007 (24.0 Mb)
ppp0 Link encap:Point-to-Point Protocol
inet addr:83.109.30.87 P-t-P:83.109.0.0 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:167860 errors:0 dropped:0 overruns:0 frame:0
TX packets:93784 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:130976998 (124.9 Mb) TX bytes:5465812 (5.2 Mb)
Code: Select all
proc get-nat-ip {} {
set f [open "|/sbin/ifconfig -a"]
while {![eof $f]} {lappend x [gets $f]}
close $f
foreach line $x {
if [string match "*inet *" $line] {
set ip [lindex [split [string trim $line]] 1]
set ip [lindex [split $ip :] 1]
if [string match 127.0.0.* $ip] continue
if [string match 192.168.* $ip] continue
return $ip
}
}
}