-
Notifications
You must be signed in to change notification settings - Fork 3
/
nickserv.bmod
46 lines (42 loc) · 1.29 KB
/
nickserv.bmod
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
#!/usr/bin/env bash
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, June 1991.
#
# 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 program. If not, see <https://www.gnu.org/licenses/gpl-2.0.html>,
# or in pdf format at <http://www.dhampir.no/stuff/private/gpl-2.0.pdf>
# Copyright 2012 - Øyvind 'bolt' Hvidsten <bolt@dhampir.no>
# process notices
if
! $srv &&
[[ "$cmd" = "NOTICE" ]]
then
case "$src" in
"NickServ!NickServ@services.") # freenode
case "$data" in
"This nickname is registered."*)
sf_stdoutv "$MOD: identifying"
tx "PRIVMSG $(src_nick) :IDENTIFY $NICK $PASS"
;;
"Invalid password for ${NICK}.")
sf_error "Nickserv told us our password was invalid :("
exit 1
;;
esac
;;
esac
fi
# keep our name
function nickserv_tick
{
[[ "$nick" != "$NICK" ]] || return 0
sf_timer "nickserv" 10 || return 0
sf_stdoutv "$MOD: Wrong name! Attempting to change!"
tx "NICK $NICK"
}
nickserv_tick