/usr/share/irssi/scripts/akilluser.pl is in irssi-scripts 20131030.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | # AKILL a specified nick, either with the defined reason or with something given
# in the command
#
# (C) 2006 by Joerg Jaspert <joerg@debian.org>
# (C) 2007 by Christoph Berg <cb@df7cb.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this script; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = '0.2';
%IRSSI = (
authors => 'Joerg Jaspert',
contact => 'joerg@debian.org',
name => 'akilluser',
description => 'AKILLS a nick',
license => 'GPL v2 (and no later)',
);
########################################################################
# Kill it
sub akill_nick {
my ($arg, $server, $channel) = @_;
$arg =~ /(\S+)\s?(.*)?/;
my ($target, $reason) = ($1, $2);
my ($user, $host);
if ($target =~ /(.+)@(.+)/) {
($user, $host) = ($1, $2);
} else {
if (!$channel) {
Irssi::print("Not joined to a channel");
return;
}
my $nickh = $channel->nick_find($target);
if (!$nickh->{host}) {
Irssi::print("User $target not found on $channel->{name}");
return;
}
if ($nickh->{host} =~ /\.oftc\.net$/) { # Do not AKILL staff from oftc.
Irssi::print("Not AKILLing OFTC staff");
return;
}
$nickh->{host} =~ /(\S+)@(\S+)/;
($user, $host) = ("*", $2);
}
if ("$user$host" !~ /[\w\d]/) {
Irssi::print("AKILLing $user\@$host looks insane");
return;
}
if (length($reason) < 2) {
$reason = Irssi::settings_get_str('akill_reason');
}
if ($reason !~ /\@oftc\.net/) {
$reason .= " " . Irssi::settings_get_str('akill_trailer');
}
my $window = Irssi::active_win();
$window->print("AKILLed $target ($user\@$host) with \"$reason\"");
$server->command("quote os akill add $user\@$host $reason");
}
########################################################################
# ---------- Do the startup tasks ----------
# Add the settings
Irssi::settings_add_str("akilluser.pl", "akill_reason", 'This host violated network policy.');
Irssi::settings_add_str("akilluser.pl", "akill_trailer", 'Mail support@oftc.net if you think this in error.');
Irssi::command_bind('akill', 'akill_nick');
|