[cvslog] Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Fri Sep 28 09:08:00 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2001-09-28 14:07:36 UTC
Commited by: Jeff Fisher <guppy at techmonkeys.org>

Modified files:
     eggdrop.complete.conf doc/UPDATES1.6 doc/html/egg-core.html
     doc/settings/core.settings scripts/autobotchk scripts/botchk
     src/main.c src/patch.h src/tcl.c

Log message:

newe pid file setting

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.185 eggdrop1.6/doc/UPDATES1.6:1.186
--- eggdrop1.6/doc/UPDATES1.6:1.185	Thu Sep 27 21:47:48 2001
+++ eggdrop1.6/doc/UPDATES1.6	Fri Sep 28 09:07:25 2001
@@ -1,10 +1,11 @@
-$Id: UPDATES1.6,v 1.185 2001/09/28 02:47:48 poptix Exp $
+$Id: UPDATES1.6,v 1.186 2001/09/28 14:07:25 guppy Exp $
 
 Changes in eggdrop: (since v1.6.0)
 ----------------------------------
 
 1.6.7
 Found by  Fixed by  What...
+Tothwolf  guppy     new setting: pidfile (detaults to pid.botnetnick)
           poptix    oops, .kickban -nick didn't work.
           BarkerJr  backported a check for -dynamicbans to new[ban|exempt|invite]
           guppy     replaced old md5 routines with new ones (backport from 1.7)
Index: eggdrop1.6/doc/html/egg-core.html
diff -u eggdrop1.6/doc/html/egg-core.html:1.8 eggdrop1.6/doc/html/egg-core.html:1.9
--- eggdrop1.6/doc/html/egg-core.html:1.8	Sun Sep 23 23:25:39 2001
+++ eggdrop1.6/doc/html/egg-core.html	Fri Sep 28 09:07:25 2001
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<!-- $Id: egg-core.html,v 1.8 2001/09/24 04:25:39 guppy Exp $ -->
+<!-- $Id: egg-core.html,v 1.9 2001/09/28 14:07:25 guppy Exp $ -->
 
 <html>
   <head>
@@ -313,6 +313,12 @@
         <dd>
           <p>Specify here how your userfile should be called</p>
         </dd>
+
+	<dt><strong>set pidfile &quot;pid.LamestBot&quot;</strong</dt>
+
+	<dd>
+	  <p>Specify here what filename eggdrop will save its pid under</p>
+	</dd>
 
         <dt><strong><em>set sort-users 0</em></strong></dt>
 
Index: eggdrop1.6/doc/settings/core.settings
diff -u eggdrop1.6/doc/settings/core.settings:1.5 eggdrop1.6/doc/settings/core.settings:1.6
--- eggdrop1.6/doc/settings/core.settings:1.5	Sun Sep 23 23:25:39 2001
+++ eggdrop1.6/doc/settings/core.settings	Fri Sep 28 09:07:25 2001
@@ -174,6 +174,8 @@
 set userfile "LamestBot.user"
     Specify here how your userfile should be called
 
+set pidfile "pid.LamestBot"
+    Specify here what filename eggdrop will save its pid under
 
 set sort-users 0
     If  you want your userfile to be sorted on save, turn this feature on.
Index: eggdrop1.6/eggdrop.complete.conf
diff -u eggdrop1.6/eggdrop.complete.conf:1.34 eggdrop1.6/eggdrop.complete.conf:1.35
--- eggdrop1.6/eggdrop.complete.conf:1.34	Sun Sep 23 23:25:38 2001
+++ eggdrop1.6/eggdrop.complete.conf	Fri Sep 28 09:07:25 2001
@@ -1,7 +1,7 @@
 #! /path/to/executable/eggdrop
 # ^- set that to the directory eggdrop is in i.e. "#! /home/lamest/egg/eggdrop"
 #
-# $Id: eggdrop.complete.conf,v 1.34 2001/09/24 04:25:38 guppy Exp $
+# $Id: eggdrop.complete.conf,v 1.35 2001/09/28 14:07:25 guppy Exp $
 #
 # This config file includes all possible options you can
 # use to configure your bot properly.
@@ -151,6 +151,9 @@
 
 # the userfile: where user records are stored
 set userfile "LamestBot.user"
+
+# the pidfile: where eggdrop saves its pid file to
+# set pidfile "pid.${botnet-nick}"
 
 # [0/1] do you want the userlist to be sorted when saving
 set sort-users 0
Index: eggdrop1.6/scripts/autobotchk
diff -u eggdrop1.6/scripts/autobotchk:1.5 eggdrop1.6/scripts/autobotchk:1.6
--- eggdrop1.6/scripts/autobotchk:1.5	Fri Apr 13 14:19:14 2001
+++ eggdrop1.6/scripts/autobotchk	Fri Sep 28 09:07:25 2001
@@ -29,7 +29,7 @@
 done; \
 exec tclsh$lastver "$0" "$@"
 #
-# AutoBotchk, (C)1999 Jeff Fisher (guppy at eggheads.org)
+# AutoBotchk, (C)2001 Jeff Fisher (guppy at eggheads.org)
 #
 # updates
 # -------
@@ -45,8 +45,9 @@
 #           changes in the eggdrop copy.
 #  13Apr01: borrowed code from Tothwolf's Wolfpack to find tclsh
 #           better
+#  27Sep01: added new pidfile setting
 #
-# $Id: autobotchk,v 1.5 2001/04/13 19:19:14 guppy Exp $
+# $Id: autobotchk,v 1.6 2001/09/28 14:07:25 guppy Exp $
 #
 # how to use
 # ----------
@@ -60,20 +61,6 @@
 #  to use, for example, './autobotchk eggdrop.conf -dir /home/bot'
 #  this now allows you to run the program from any dir :P~
 #
-# other Stuff
-# -----------
-# [22:36] <cHr|s`> when you type ./autobotchk without any options, it should give you the menu
-# [22:36] <cHr|s`> like the nukes do
-#  ^ -- he might be Urkel, but we love him anyways ..
-# [18:10] <[z]> nope...came back weith can't crontab -l error
-#  ^ -- no one said this script was perfect, mmmm z's wife
-# [19:27] <[z]> also guppy..would be nice if i could reference my bots directories ;)
-#  ^ -- just when I finished 1.05 :P
-# [18:50] <[s]> how to set the autobotchk not to recieve e-mails about the cron ??
-# [18:51] <slennox> add >/dev/null 2>&1 to the end of the crontab entry
-# [18:52] <[s]> what crontab
-# [18:52] <[s]> i have gupy's script
-# [18:52] <[s]> autobotchk
 
 if {$argc == 0} {
  puts "\nusage: $argv0 <eggdrop config> \[options\]"
@@ -85,7 +72,7 @@
  puts " -30      (30 minute checks)\n\n"
  exit
 } {
- puts "\nAutoBotchk 1.08, (C)1999 Jeff Fisher (guppy at eggheads.org)"
+ puts "\nAutoBotchk 1.09, (C)2001 Jeff Fisher (guppy at eggheads.org)"
  puts "----------------------------------------------------------"
 
  set x [join [lindex [split $argv] 0]]
@@ -149,6 +136,7 @@
   set z [split [gets $f]]
   if {[join [lindex $z 0]] != "set"} {continue}
   switch -- [join [lindex $z 1]] {
+   pidfile -
    nick -
    userfile -
    botnet-nick {
@@ -159,9 +147,13 @@
  }
  close $f
  if {![info exists {botnet-nick}] && [info exists nick]} {
-  puts "         !! setting \$botnet-nick to \$nick"
+  puts "         !! setting \$botnet-nick to $nick"
   set botnet-nick $nick
  }
+ if {![info exists pidfile]} {
+  puts "         !! setting \$pidfile to pid.${botnet-nick}"
+  set pidfile "pid.${botnet-nick}"
+ }
  if {![info exists {botnet-nick}] || ![info exists userfile]} {
   puts " *** ERROR: could not find either \$userfile or \$botnet-nick"
   puts "      !! you sure its a valid Eggdrop config file?\n\n"
@@ -175,10 +167,10 @@
  puts $fd "
 #! /bin/sh
 #
-# new botchk  (for eggdrop 1.1+)
+# botchk
 #
 # Created on: [clock format [clock seconds] -format "%B %d, %Y @ %I:%M%p"]
-# Created by: AutoBotchk 1.08 (C)1999 Jeff Fisher
+# Created by: AutoBotchk 1.09 (C)2001 Jeff Fisher
 #
 # This is a script suitable for use in a crontab.  It checks to make sure
 # your bot is running.  YOU NEED A SEPARATE CRON JOB FOR EACH BOT.  If your
@@ -206,23 +198,26 @@
 # change this to the name of your bot's userfile (capitalization COUNTS)
 userfile=\"$userfile\"
 
+# change this to the name of your bot's pidfile (capitalization COUNTS)
+pidfile=\"$pidfile\"
+
 ########## you probably don't need to change anything below here ##########
 
 cd \$botdir
 
 # is there a pid file?
-if test -r pid.\$botname
+if test -r \$pidfile
 then
   # there is a pid file -- is it current?
-  botpid=`cat pid.\$botname`
+  botpid=`cat \$pidfile`
   if `kill -CHLD \$botpid >/dev/null 2>&1`
   then
     # it's still going -- back out quietly
     exit 0
   fi
   echo \"\"
-  echo \"Stale pid.\$botname file, erasing...\"
-  rm -f pid.\$botname
+  echo \"Stale \$pidfile file, erasing...\"
+  rm -f \$pidfile
 fi
 
 if test -r CANTSTART.\$botname
Index: eggdrop1.6/scripts/botchk
diff -u eggdrop1.6/scripts/botchk:1.4 eggdrop1.6/scripts/botchk:1.5
--- eggdrop1.6/scripts/botchk:1.4	Tue Dec 21 11:35:08 1999
+++ eggdrop1.6/scripts/botchk	Fri Sep 28 09:07:25 2001
@@ -1,8 +1,8 @@
 #! /bin/sh
 #
-# new botchk  (for eggdrop 1.1+)
+# botchk
 #
-# $Id: botchk,v 1.4 1999/12/21 17:35:08 fabian Exp $
+# $Id: botchk,v 1.5 2001/09/28 14:07:25 guppy Exp $
 #
 # This is a script suitable for use in a crontab.  It checks to make sure
 # your bot is running.  YOU NEED A SEPARATE CRON JOB FOR EACH BOT.  If your
@@ -12,10 +12,10 @@
 #
 # To check for your bot every 10 minutes, put the following line in your
 # crontab:
-#    0,10,20,30,40,50 * * * *   /home/mydir/botchk
+#    0,10,20,30,40,50 * * * *   /home/mydir/mybot/botchk
 # And if you don't want to get email from crontab when it checks you bot,
 # put the following in your crontab:
-#    0,10,20,30,40,50 * * * *   /home/mydir/botchk >/dev/null 2>&1
+#    0,10,20,30,40,50 * * * *   /home/mydir/mybot/botchk >/dev/null 2>&1
 #
 
 # change this to the directory you run your bot from:
@@ -25,28 +25,31 @@
 botscript="mybot"
 
 # change this to the nickname of your bot (capitalization COUNTS)
-botname="Doofy"
+botname="LamestBot"
 
 # change this to the name of your bot's userfile (capitalization COUNTS)
-userfile="Doofy.user"
+userfile="LamestBot.user"
+
+# change this to the name of your bot's pidfile (capitalization COUNTS)
+pidfile="pid.LamestBot"
 
 ########## you probably don't need to change anything below here ##########
 
 cd $botdir
 
 # is there a pid file?
-if test -r pid.$botname
+if test -r $pidfile
 then
   # there is a pid file -- is it current?
-  botpid=`cat pid.$botname`
+  botpid=`cat $pidfile`
   if `kill -CHLD $botpid >/dev/null 2>&1`
   then
     # it's still going -- back out quietly
     exit 0
   fi
   echo ""
-  echo "Stale pid.$botname file, erasing..."
-  rm -f pid.$botname
+  echo "Stale $pidfile file, erasing..."
+  rm -f $pidfile
 fi
 
 if test -r CANTSTART.$botname
Index: eggdrop1.6/src/main.c
diff -u eggdrop1.6/src/main.c:1.71 eggdrop1.6/src/main.c:1.72
--- eggdrop1.6/src/main.c:1.71	Sun Sep 23 23:25:39 2001
+++ eggdrop1.6/src/main.c	Fri Sep 28 09:07:26 2001
@@ -5,7 +5,7 @@
  *   command line arguments
  *   context and assert debugging
  *
- * $Id: main.c,v 1.71 2001/09/24 04:25:39 guppy Exp $
+ * $Id: main.c,v 1.72 2001/09/28 14:07:26 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -104,7 +104,7 @@
 int	make_userfile = 0;	/* Using bot in make-userfile mode? (first
 				   user to 'hello' becomes master) */
 char	owner[121] = "";	/* Permanent owner(s) of the bot */
-char	pid_file[HANDLEN + 5];		/* Name of the file for the pid to be
+char	pid_file[120];		/* Name of the file for the pid to be
 				   stored in */
 int	save_users_at = 0;	/* How many minutes past the hour to
 				   save the userfile? */
@@ -802,6 +802,7 @@
 	 botnetnick, i, count_users(userlist));
   cache_miss = 0;
   cache_hit = 0;
+  if (!pid_file[0])
   egg_snprintf(pid_file, sizeof pid_file, "pid.%s", botnetnick);
 
   /* Check for pre-existing eggdrop! */
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.558 eggdrop1.6/src/patch.h:1.559
--- eggdrop1.6/src/patch.h:1.558	Thu Sep 27 21:47:48 2001
+++ eggdrop1.6/src/patch.h	Fri Sep 28 09:07:26 2001
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.558 2001/09/28 02:47:48 poptix Exp $
+ * $Id: patch.h,v 1.559 2001/09/28 14:07:26 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1001645204");		/* current unixtime */
+patch("1001685847");		/* current unixtime */
 /*
  *
  *
  */
-patch("kickban");
+patch("pidfile");
 /*
  *
  *
Index: eggdrop1.6/src/tcl.c
diff -u eggdrop1.6/src/tcl.c:1.39 eggdrop1.6/src/tcl.c:1.40
--- eggdrop1.6/src/tcl.c:1.39	Tue Sep 25 18:11:59 2001
+++ eggdrop1.6/src/tcl.c	Fri Sep 28 09:07:26 2001
@@ -4,7 +4,7 @@
  *   Tcl initialization
  *   getting and setting Tcl/eggdrop variables
  *
- * $Id: tcl.c,v 1.39 2001/09/25 23:11:59 guppy Exp $
+ * $Id: tcl.c,v 1.40 2001/09/28 14:07:26 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -54,7 +54,7 @@
 		firewall[], helpdir[], notify_new[], hostname[], myip[],
 		moddir[], tempdir[], owner[], network[], botnetnick[],
 		bannerfile[], egg_version[], natip[], configfile[],
-		logfile_suffix[], textdir[];
+		logfile_suffix[], textdir[], pid_file[];
 extern int	die_on_sighup, die_on_sigterm, max_logs, max_logsize,
 		enable_simul, dcc_total, debug_output, identtimeout,
 		protect_telnet, dupwait_timeout, egg_numver, share_unlinks,
@@ -430,6 +430,7 @@
   {"config",		configfile,	0,		0},
   {"telnet-banner",	bannerfile,	120,		STR_PROTECT},
   {"logfile-suffix",	logfile_suffix,	20,		0},
+  {"pidfile",		pid_file,       120,		STR_PROTECT},
   {NULL,		NULL,		0,		0}
 };
 
----------------------- End of diff -----------------------



More information about the Changes mailing list