[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tcldrop/CVS] tcldrop/modules core.tcl
From: |
Philip Moore |
Subject: |
[Tcldrop/CVS] tcldrop/modules core.tcl |
Date: |
Tue, 18 Nov 2003 20:27:50 -0500 |
CVSROOT: /cvsroot/tcldrop
Module name: tcldrop
Branch:
Changes by: Philip Moore <address@hidden> 03/11/18 20:27:49
Modified files:
modules : core.tcl
Log message:
Added support for the $pidfile setting.. It now creates a
pid.botnet-nick file on init. (And deletes the file when the bot dies)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/tcldrop/tcldrop/modules/core.tcl.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
Patches:
Index: tcldrop/modules/core.tcl
diff -u tcldrop/modules/core.tcl:1.17 tcldrop/modules/core.tcl:1.18
--- tcldrop/modules/core.tcl:1.17 Sat Nov 15 21:53:24 2003
+++ tcldrop/modules/core.tcl Tue Nov 18 20:27:49 2003
@@ -1,6 +1,6 @@
# core.tcl --
#
-# $Id: core.tcl,v 1.17 2003/11/16 02:53:24 fireegl Exp $
+# $Id: core.tcl,v 1.18 2003/11/19 01:27:49 fireegl Exp $
#
# Copyright (C) 2003 FireEgl (Philip Moore) <address@hidden>
#
@@ -47,7 +47,7 @@
# Provide the users module:
variable version {0.3}
package provide tcldrop::core $version
- variable rcsid {$Id: core.tcl,v 1.17 2003/11/16 02:53:24 fireegl Exp $}
+ variable rcsid {$Id: core.tcl,v 1.18 2003/11/19 01:27:49 fireegl Exp $}
# Initialize variables:
variable Binds
variable Timers
@@ -612,6 +612,17 @@
callevent $type
callevent loaded
}
+
+bind evnt - init ::tcldrop::MakePIDFile
+proc ::tcldrop::MakePIDFile {event} { global pidfile botnet-nick
+ if {![info exists pidfile] || $pidfile == {}} { set pidfile
"pid.${botnet-nick}" }
+ set fid [open $pidfile w]
+ puts $fid [pid]
+ close $fid
+}
+
+bind evnt - die ::tcldrop::DeletePIDFile
+proc ::tcldrop::DeletePIDFile {event} { catch { file delete -force --
$::pidfile } }
# And now we set everything into motion... =D
if {[catch { restart {start} }]} {