diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:19:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:19:02 +0000 |
commit | 03929dac2a29664878d2c971648a4fe1fb698462 (patch) | |
tree | 02c5e2b3e006234aa29545f7a93a1ce01b291a8b /scripts/ipupdate.pl | |
parent | Initial commit. (diff) | |
download | irssi-scripts-74dedaab1f75de511e9ded8f64dcf9a4c7d2946f.tar.xz irssi-scripts-74dedaab1f75de511e9ded8f64dcf9a4c7d2946f.zip |
Adding upstream version 20231031.upstream/20231031upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/ipupdate.pl')
-rw-r--r-- | scripts/ipupdate.pl | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/scripts/ipupdate.pl b/scripts/ipupdate.pl new file mode 100644 index 0000000..dc99c45 --- /dev/null +++ b/scripts/ipupdate.pl @@ -0,0 +1,39 @@ +# IPupdate 1.2 +# +# automatically update your IP on server connections +# +# original create by legion (a.lepore@email.it) +# +# thanks xergio for IP show php script :> +# +# Fixed by Axel Gembe <derago@gmail.com> to use ifconfig.co/ip +# because the original server did not work anymore. + +use strict; +use Irssi; +use vars qw($VERSION %IRSSI); +require LWP::UserAgent; +use HTTP::Request::Common; + +$VERSION = '1.3'; +%IRSSI = ( + authors => 'xlony, Axel Gembe', + contact => 'anderfdez@yahoo.es', + name => 'IPupdate', + description => 'Auto "/set dcc_own_ip IP" on connect.', + license => 'GPL', + changed => '2017-11-08', +); + +sub ipset { + my $user = LWP::UserAgent->new(timeout => 30); + my $get = GET "http://ifconfig.co/ip"; + my $req = $user->request($get); + my $out = $req->content(); + + Irssi::print("%9IP update%_:", MSGLEVEL_CRAP); + Irssi::command("set dcc_own_ip $out"); +} + +Irssi::signal_add('server connected', 'ipset'); +Irssi::command_bind('ipupdate', 'ipset'); |