aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-04-16 07:42:39 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-04-16 07:42:39 -0400
commit5daca98b438dbe6ad993b2918001c59481126e7d (patch)
treed4562b15701046d30fd781daa959b2f717c59dff
parentAdded option to force nick. (diff)
downloadirker-5daca98b438dbe6ad993b2918001c59481126e7d.tar.xz
Added -p option.
-rw-r--r--NEWS2
-rwxr-xr-xirkerd9
-rw-r--r--irkerd.xml7
3 files changed, 15 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index f72b883..1f63f66 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@
1.18
Added -l option; irker can now be used as a channel monitor.
- Added -n option: the nick can be forced.
+ Added -n and -p option: the nick can be forced and authenticated.
1.17 @ 2013-02-03
Various minor fixes and bulletproofing.
diff --git a/irkerd b/irkerd
index d3ea230..3889cc7 100755
--- a/irkerd
+++ b/irkerd
@@ -122,6 +122,8 @@ class Connection:
"The server says we're OK, with a non-conflicting nick."
self.status = "ready"
self.irker.debug(1, "nick %s accepted" % self.nickname())
+ if password:
+ self.connection.privmsg("nickserv", "identify %s" % password)
def handle_badnick(self):
"The server says our nick is ill-formed or has a conflict."
self.irker.debug(1, "nick %s rejected" % self.nickname())
@@ -468,7 +470,7 @@ class Irker:
self.debug(1, "irker has been kicked from %s on %s" % (target, connection.server))
if connection.context:
connection.context.handle_kick(target)
- def _handle_all_raw_messages(self, connection, event):
+ def _handle_all_raw_messages(self, _connection, event):
"Log all messages when in watcher mode."
with open(logfile, "w") as logfp:
logfp.write("%03f|%s|%s\n" % \
@@ -545,8 +547,9 @@ class IrkerUDPHandler(SocketServer.BaseRequestHandler):
if __name__ == '__main__':
debuglvl = 0
namestyle = "irker%03d"
+ password = None
logfile = None
- (options, arguments) = getopt.getopt(sys.argv[1:], "d:l:n:V:")
+ (options, arguments) = getopt.getopt(sys.argv[1:], "d:l:n:p:V:")
for (opt, val) in options:
if opt == '-d': # Enable debug/progress messages
debuglvl = int(val)
@@ -556,6 +559,8 @@ if __name__ == '__main__':
logfile = val
elif opt == '-n': # Force the nick
namestyle = val
+ elif opt == '-p': # Set a nickserv password
+ password = val
elif opt == '-V': # Emit version and exit
sys.stdout.write("irkerd version %s\n" % version)
sys.exit(0)
diff --git a/irkerd.xml b/irkerd.xml
index 54d2ffb..345c053 100644
--- a/irkerd.xml
+++ b/irkerd.xml
@@ -21,6 +21,7 @@
<arg>-d <replaceable>debuglevel</replaceable></arg>
<arg>-l <replaceable>logfile</replaceable></arg>
<arg>-n <replaceable>nick</replaceable></arg>
+ <arg>-p <replaceable>password</replaceable></arg>
<arg>-V</arg>
</cmdsynopsis>
</refsynopsisdiv>
@@ -88,6 +89,12 @@ to be used. If the nick contains a numeric format element
in the event of a nick collision.</para></listitem>
</varlistentry>
<varlistentry>
+<term>-p</term>
+<listitem><para>Takes a following value, setting a nickserv
+password to be used. If given, this password is shipped to
+authenticate the nick on receipt of a welcom message.</para></listitem>
+</varlistentry>
+<varlistentry>
<term>-V</term>
<listitem><para>Write the program version to stdout and
terminate.</para></listitem>