Skip to content

Instantly share code, notes, and snippets.

@eloyesp
Created May 12, 2015 17:52
Show Gist options
  • Save eloyesp/fb31135b22d44904da2e to your computer and use it in GitHub Desktop.
Save eloyesp/fb31135b22d44904da2e to your computer and use it in GitHub Desktop.
# Uses password from .netrc when stablishing connections
use strict;
use warnings;
use vars qw($VERSION %IRSSI);
use Irssi;
use Data::Dumper;
$VERSION = '0.01';
%IRSSI = (
authors => 'Eloy Espinaco',
contact => '[email protected]',
name => 'irssi-netrc',
description => 'Use netrc to store passwords',
license => 'GPL',
);
sub handle_connection {
my (@server) = @_;
print 'connecting to: ';
print Dumper(@server);
print $server[0]{'password'};
print $server[0]{'password'} = 'other';
print $server[0]{'password'};
Irssi::signal_stop();
}
Irssi::signal_add('server connecting', 'handle_connection');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment