I have a ISP that gives me a dynamic IP. I have set the NAT-IP in the eggdrop.conf, but i wonder if there is a script or some way that i can changse this automaticly??
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
}
}
}
okay.. i tried both tings, as a seperate script and sourced to it, and as the first thing in my config-file. The bot starts like normal and links up, but when it sends the userfile, it wont work
[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)
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..
it might be that the script's not working correctly - that's why I already said it may need tweaking for your ifconfig - check that by issuing the `ifconfig -a' command in your shell
and it might be that script's working perfectly and you have other problems - firewall, closed ports. etc.
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
}
}
}