]> git.donarmstrong.com Git - infobot.git/commitdiff
- killall -HUP now doesn't write then read the user/chan file.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 23 Feb 2003 12:45:10 +0000 (12:45 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 23 Feb 2003 12:45:10 +0000 (12:45 +0000)
  good for modifying the config files by hand.

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@767 c11ca15a-4712-0410-83d8-924469b57eb5

blootbot/src/core.pl

index dbdc509b58fa497463a85c7a8d4b5a6151350213..4c5d0e7e6f23b3efa515197564ee31b26fc0c52b 100644 (file)
@@ -321,7 +321,7 @@ sub getChanConfDefault {
 
     if (exists $param{$what}) {
        if (!exists $cache{config}{$what}) {
-           &status("conf: backward-compat: found param{$what} ($param{$what}) for $chan instead.");
+           &status("Config ($chan): backward-compatible option: found param{$what} ($param{$what}) instead");
            $cache{config}{$what} = 1;
        }
 
@@ -331,7 +331,7 @@ sub getChanConfDefault {
     return $val if (defined $val);
 
     $param{$what}      = $default;
-    &status("conf: $chan auto-setting param{$what} = $default");
+    &status("Config ($chan): auto-setting param{$what} = $default");
     $cache{config}{$what} = 1;
     return $default;
 }
@@ -487,15 +487,18 @@ sub startup {
 }
 
 sub shutdown {
+    my ($sig) = @_;
     # reverse order of &setup().
     &status("--- shutdown called.");
 
     $ident ||= "blootbot";     # hack.
 
-    # opened files must be written to on shutdown/hup/whatever
-    # unless they're write-only, like uptime.
-    &writeUserFile();
-    &writeChanFile();
+    if ($sig eq "HUP") {
+       &status("::: not writing user/chan file w/ SIGHUP");
+    } else {
+       &writeUserFile();
+       &writeChanFile();
+    }
 
     &sqlCloseDB();
     &closeSHM($shm);   # aswell. TODO: use this in &doExit?
@@ -522,7 +525,7 @@ sub restart {
        &ircCheck();    # heh, evil!
 
        &DCCBroadcast("-HUP called.","m");
-       &shutdown();
+       &shutdown($sig);
        &loadConfig($bot_config_dir."/blootbot.config");
        &reloadAllModules() if (&IsParam("DEBUG"));
        &setup();