]> git.donarmstrong.com Git - infobot.git/blobdiff - src/core.pl
- write opened files on shutdown/hup
[infobot.git] / src / core.pl
index 02db5aac7f17420778a8221dfcbc8c13f480fa3a..1c7b6d4ce63e62b5b255901fdb3263ad066cda9b 100644 (file)
@@ -354,6 +354,12 @@ sub shutdown {
     # reverse order of &setup().
     &DEBUG("shutdown called.");
 
+    # opened files must be written to on shutdown/hup/whatever
+    # unless they're write-only, like uptime.
+    &writeUserFile();
+    &writeChanFile();
+    &News::writeNews() if (&ChanConfList("news"));
+
     &closeDB();
     &closeSHM($shm);   # aswell. TODO: use this in &doExit?
     &closeLog();