diff options
author | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-09-29 17:54:07 +0000 |
---|---|---|
committer | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-09-29 17:54:07 +0000 |
commit | f11e06eca8712a1dd7d308713baee2e4dd6d6997 (patch) | |
tree | d996b910b9e77135b2a9501b7fd79fce90bd9f46 /src/modules/hs_request.c | |
parent | c565a28c43dd73b167c45dde4a7f7fb41183a7a5 (diff) |
BUILD : 1.7.15 (1162) BUGS : 604 NOTES : Added functions to let modules backup their own databases and added this functionality to the bundled modules
git-svn-id: svn://svn.anope.org/anope/trunk@1162 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@884 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modules/hs_request.c')
-rw-r--r-- | src/modules/hs_request.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c index 0494a08c9..38ec0e04d 100644 --- a/src/modules/hs_request.c +++ b/src/modules/hs_request.c @@ -76,6 +76,7 @@ int ns_do_drop(User * u); void hsreq_save_db(void); void hsreq_load_db(void); int hsreqevt_db_saving(int argc, char **argv); +int hsreqevt_db_backup(int argc, char **argv); void my_load_config(void); void my_add_languages(void); @@ -117,6 +118,9 @@ int AnopeInit(int argc, char **argv) hook = createEventHook(EVENT_DB_SAVING, hsreqevt_db_saving); moduleAddEventHook(hook); + hook = createEventHook(EVENT_DB_BACKUP, hsreqevt_db_backup); + moduleAddEventHook(hook); + moduleSetHostHelp(hs_help); moduleAddAuthor(AUTHOR); moduleAddVersion(VERSION); @@ -680,6 +684,18 @@ int hsreqevt_db_saving(int argc, char **argv) return MOD_CONT; } +int hsreqevt_db_backup(int argc, char **argv) +{ + if ((argc >= 1) && (stricmp(argv[0], EVENT_START) == 0)) { + if (HSRequestDBName) + ModuleDatabaseBackup(HSRequestDBName); + else + ModuleDatabaseBackup(HSREQ_DEFAULT_DBNAME); + } + + return MOD_CONT; +} + void my_load_config(void) { int i; |