2001-08-17 05:46:24 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
2001-11-04 16:41:54 +00:00
|
|
|
* $Id$
|
2001-08-17 05:46:24 +00:00
|
|
|
* Purpose ...............: Setup Program
|
|
|
|
*
|
|
|
|
*****************************************************************************
|
2004-02-01 17:04:00 +00:00
|
|
|
* Copyright (C) 1997-2004
|
2001-08-17 05:46:24 +00:00
|
|
|
*
|
2001-10-25 11:14:57 +00:00
|
|
|
* Michiel Broek FIDO: 2:280/2802
|
2001-08-17 05:46:24 +00:00
|
|
|
* Beekmansbos 10
|
|
|
|
* 1971 BV IJmuiden
|
|
|
|
* the Netherlands
|
|
|
|
*
|
|
|
|
* This file is part of MBSE BBS.
|
|
|
|
*
|
|
|
|
* This BBS is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2, or (at your option) any
|
|
|
|
* later version.
|
|
|
|
*
|
|
|
|
* MB BBS is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with MB BBS; see the file COPYING. If not, write to the Free
|
2003-08-15 20:05:34 +00:00
|
|
|
* Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
2001-08-17 05:46:24 +00:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2002-06-30 12:48:44 +00:00
|
|
|
#include "../config.h"
|
2004-02-21 17:22:00 +00:00
|
|
|
#include "../lib/mbselib.h"
|
2004-05-02 12:30:57 +00:00
|
|
|
#include "../lib/users.h"
|
|
|
|
#include "../lib/mbsedb.h"
|
2001-08-17 05:46:24 +00:00
|
|
|
#include "screen.h"
|
|
|
|
#include "mutil.h"
|
|
|
|
#include "ledit.h"
|
|
|
|
#include "m_global.h"
|
|
|
|
#include "m_bbs.h"
|
2001-10-19 14:25:14 +00:00
|
|
|
#include "m_farea.h"
|
|
|
|
#include "m_fgroup.h"
|
2001-08-17 05:46:24 +00:00
|
|
|
#include "m_mail.h"
|
2001-10-19 21:10:43 +00:00
|
|
|
#include "m_mgroup.h"
|
|
|
|
#include "m_hatch.h"
|
2001-08-17 05:46:24 +00:00
|
|
|
#include "m_tic.h"
|
2001-10-19 21:10:43 +00:00
|
|
|
#include "m_ticarea.h"
|
|
|
|
#include "m_magic.h"
|
2001-08-17 05:46:24 +00:00
|
|
|
#include "m_fido.h"
|
2001-10-19 21:10:43 +00:00
|
|
|
#include "m_lang.h"
|
2001-08-17 05:46:24 +00:00
|
|
|
#include "m_archive.h"
|
|
|
|
#include "m_virus.h"
|
|
|
|
#include "m_tty.h"
|
|
|
|
#include "m_limits.h"
|
|
|
|
#include "m_users.h"
|
|
|
|
#include "m_node.h"
|
|
|
|
#include "m_fdb.h"
|
|
|
|
#include "m_new.h"
|
2001-10-19 21:10:43 +00:00
|
|
|
#include "m_ol.h"
|
2002-05-05 17:34:07 +00:00
|
|
|
#include "m_bbslist.h"
|
2001-10-19 21:10:43 +00:00
|
|
|
#include "m_protocol.h"
|
2001-08-17 05:46:24 +00:00
|
|
|
#include "m_ff.h"
|
|
|
|
#include "m_modem.h"
|
|
|
|
#include "m_marea.h"
|
|
|
|
#include "m_ngroup.h"
|
|
|
|
#include "m_service.h"
|
|
|
|
#include "m_domain.h"
|
|
|
|
#include "m_task.h"
|
2002-07-16 21:05:00 +00:00
|
|
|
#include "m_route.h"
|
2001-08-17 05:46:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
mode_t oldmask; /* Old umask value */
|
|
|
|
extern int do_quiet; /* Suppress log to screen */
|
2002-05-04 19:45:19 +00:00
|
|
|
extern int bbs_free; /* Free/Busy status */
|
2004-03-29 20:41:26 +00:00
|
|
|
extern int horiz; /* Dot position in docs */
|
2001-08-17 05:46:24 +00:00
|
|
|
int exp_golded = FALSE; /* Export GoldED config */
|
2001-10-25 11:14:57 +00:00
|
|
|
int init = FALSE; /* Run init only */
|
2001-08-17 05:46:24 +00:00
|
|
|
|
|
|
|
|
2002-05-04 19:45:19 +00:00
|
|
|
|
2001-08-17 05:46:24 +00:00
|
|
|
static void die(int onsig)
|
|
|
|
{
|
2002-11-06 20:38:51 +00:00
|
|
|
FILE *fp;
|
|
|
|
char *temp;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
signal(onsig, SIG_IGN);
|
2003-08-03 14:08:07 +00:00
|
|
|
if ((!init) && (onsig != MBERR_NO_PROGLOCK))
|
2002-11-06 20:38:51 +00:00
|
|
|
screen_stop();
|
|
|
|
|
|
|
|
if (exp_golded && (config_read() != -1)) {
|
|
|
|
temp = calloc(PATH_MAX, sizeof(char));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Export ~/etc/msg.txt for MsgEd.
|
|
|
|
*/
|
|
|
|
sprintf(temp, "%s/etc/msg.txt", getenv("MBSE_ROOT"));
|
|
|
|
if ((fp = fopen(temp, "w")) != NULL) {
|
2002-11-08 19:33:50 +00:00
|
|
|
fprintf(fp, "; msg.txt -- Automatic created by mbsetup %s -- Do not edit!\n;\n", VERSION);
|
|
|
|
fprintf(fp, "; Mail areas for MsgEd.\n;\n");
|
2002-11-06 20:38:51 +00:00
|
|
|
msged_areas(fp);
|
|
|
|
fclose(fp);
|
|
|
|
Syslog('+', "Created new %s", temp);
|
|
|
|
} else {
|
|
|
|
WriteError("$Could not create %s", temp);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Export ~/etc/golded.inc for GoldED
|
|
|
|
*/
|
|
|
|
sprintf(temp, "%s/etc/golded.inc", getenv("MBSE_ROOT"));
|
|
|
|
if ((fp = fopen(temp, "w")) != NULL) {
|
|
|
|
fprintf(fp, "; GoldED.inc -- Automatic created by mbsetup %s -- Do not edit!\n\n", VERSION);
|
2002-11-08 19:33:50 +00:00
|
|
|
fprintf(fp, "; Basic information.\n;\n");
|
2002-11-06 20:38:51 +00:00
|
|
|
if (strlen(CFG.sysop_name) && CFG.akavalid[0] && CFG.aka[0].zone) {
|
|
|
|
fprintf(fp, "USERNAME %s\n\n", CFG.sysop_name);
|
|
|
|
fprintf(fp, "ADDRESS %s\n", aka2str(CFG.aka[0]));
|
|
|
|
for (i = 1; i < 40; i++)
|
|
|
|
if (CFG.akavalid[i])
|
|
|
|
fprintf(fp, "AKA %s\n", aka2str(CFG.aka[i]));
|
|
|
|
fprintf(fp, "\n");
|
|
|
|
|
|
|
|
gold_akamatch(fp);
|
|
|
|
fprintf(fp, "; JAM MessageBase Setup\n;\n");
|
|
|
|
fprintf(fp, "JAMPATH %s/tmp/\n", getenv("MBSE_ROOT"));
|
|
|
|
fprintf(fp, "JAMHARDDELETE NO\n\n");
|
|
|
|
|
|
|
|
fprintf(fp, "; Semaphore files\n;\n");
|
|
|
|
fprintf(fp, "SEMAPHORE NETSCAN %s/sema/mailout\n", getenv("MBSE_ROOT"));
|
|
|
|
fprintf(fp, "SEMAPHORE ECHOSCAN %s/sema/mailout\n\n", getenv("MBSE_ROOT"));
|
|
|
|
|
|
|
|
gold_areas(fp);
|
|
|
|
}
|
2002-11-08 19:33:50 +00:00
|
|
|
fclose(fp);
|
2002-11-06 20:38:51 +00:00
|
|
|
Syslog('+', "Created new %s", temp);
|
|
|
|
} else {
|
|
|
|
WriteError("$Could not create %s", temp);
|
2001-08-17 05:46:24 +00:00
|
|
|
}
|
|
|
|
|
2002-11-06 20:38:51 +00:00
|
|
|
free(temp);
|
|
|
|
}
|
|
|
|
|
2003-08-03 14:08:07 +00:00
|
|
|
ulockprogram((char *)"mbsetup");
|
2002-11-06 20:38:51 +00:00
|
|
|
umask(oldmask);
|
|
|
|
if (onsig && (onsig <= NSIG))
|
|
|
|
WriteError("MBSETUP finished on signal %s", SigName[onsig]);
|
|
|
|
else
|
|
|
|
Syslog(' ', "MBSETUP finished");
|
|
|
|
ExitClient(onsig);
|
2001-08-17 05:46:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void soft_info(void);
|
|
|
|
void soft_info(void)
|
|
|
|
{
|
|
|
|
char *temp;
|
|
|
|
|
|
|
|
temp = calloc(81, sizeof(char));
|
|
|
|
clr_index();
|
|
|
|
set_color(YELLOW, BLACK);
|
2002-02-10 17:02:45 +00:00
|
|
|
sprintf(temp, "MBSE BBS (%s-%s)", OsName(), OsCPU());
|
|
|
|
center_addstr( 6, temp);
|
2001-08-17 05:46:24 +00:00
|
|
|
set_color(WHITE, BLACK);
|
2001-11-04 16:41:54 +00:00
|
|
|
center_addstr( 8, (char *)COPYRIGHT);
|
2001-08-17 05:46:24 +00:00
|
|
|
set_color(YELLOW, BLACK);
|
|
|
|
center_addstr(10, (char *)"Made in the Netherlands");
|
|
|
|
set_color(WHITE, BLACK);
|
|
|
|
#ifdef __GLIBC__
|
|
|
|
sprintf(temp, "Compiled on glibc v%d.%d", __GLIBC__, __GLIBC_MINOR__);
|
|
|
|
#else
|
|
|
|
#ifdef __GNU_LIBRARY__
|
|
|
|
sprintf(temp, "Compiled on libc v%d", __GNU_LIBRARY__);
|
|
|
|
#else
|
|
|
|
sprintf(temp, "Compiled on unknown library");
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
center_addstr(12, temp);
|
2001-11-02 22:07:26 +00:00
|
|
|
set_color(LIGHTCYAN, BLACK);
|
2003-09-02 18:29:19 +00:00
|
|
|
center_addstr(14, (char *)"http://www.mbse.dds.nl or 2:280/2802");
|
2001-08-17 05:46:24 +00:00
|
|
|
set_color(LIGHTGREEN, BLACK);
|
2001-11-02 22:07:26 +00:00
|
|
|
center_addstr(LINES -7, (char *)"This is free software; released under the terms of the GNU General");
|
|
|
|
center_addstr(LINES -6, (char *)"Public License as published by the Free Software Foundation.");
|
2001-08-17 05:46:24 +00:00
|
|
|
set_color(CYAN, BLACK);
|
|
|
|
free(temp);
|
|
|
|
center_addstr(LINES -4, (char *)"Press any key");
|
|
|
|
readkey(LINES - 4, COLS / 2 + 8, LIGHTGRAY, BLACK);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void site_docs(void);
|
|
|
|
void site_docs(void)
|
|
|
|
{
|
2004-03-24 22:23:21 +00:00
|
|
|
FILE *fp, *hp, *toc;
|
|
|
|
char temp[PATH_MAX], temp1[PATH_MAX];
|
|
|
|
int page = 0, line = 0;
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2004-03-24 22:23:21 +00:00
|
|
|
if (config_read() == -1)
|
|
|
|
return;
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2004-04-03 18:46:54 +00:00
|
|
|
sprintf(temp, "%s/share/doc/site.doc", getenv("MBSE_ROOT"));
|
|
|
|
mkdirs(temp, 0755);
|
2004-03-24 22:23:21 +00:00
|
|
|
if ((fp = fopen(temp, "w")) == NULL)
|
|
|
|
return;
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2004-03-24 22:23:21 +00:00
|
|
|
sprintf(temp1, "%s/tmp/toc.tmp", getenv("MBSE_ROOT"));
|
|
|
|
if ((toc = fopen(temp1, "w+")) == NULL) {
|
2001-08-17 05:46:24 +00:00
|
|
|
fclose(fp);
|
2004-03-24 22:23:21 +00:00
|
|
|
return;
|
|
|
|
}
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2004-03-24 22:23:21 +00:00
|
|
|
clr_index();
|
|
|
|
working(1, 0, 0);
|
|
|
|
IsDoing("Making Sitedocs");
|
|
|
|
Syslog('+', "Start creating sitedocs");
|
|
|
|
|
|
|
|
set_color(WHITE, BLACK);
|
|
|
|
mvprintw( 5, 6, "21. CREATING SITEDOCS");
|
|
|
|
set_color(CYAN, BLACK);
|
2004-04-03 19:02:43 +00:00
|
|
|
mvprintw( 7,11, (char *)"Erasing directory %s/share/doc/html", getenv("MBSE_ROOT"));
|
2004-03-24 22:23:21 +00:00
|
|
|
fflush(stdout);
|
|
|
|
|
2004-04-03 19:02:43 +00:00
|
|
|
sprintf(temp, "-r -f %s/share/doc/html", getenv("MBSE_ROOT"));
|
2004-03-24 22:23:21 +00:00
|
|
|
execute_pth((char *)"rm", temp, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null");
|
|
|
|
|
|
|
|
if ((hp = open_webdoc((char *)"index.html", (char *)"BBS Site Documentation", NULL))) {
|
|
|
|
fprintf(hp, "<UL>\n");
|
|
|
|
fprintf(hp, " <LI><A HREF=\"global.html\">Global Configuration</A></LI>\n");
|
|
|
|
fprintf(hp, " <LI><A HREF=\"fidonet.html\">Fido Networks</A></LI>\n");
|
|
|
|
fprintf(hp, " <LI><A HREF=\"archivers.html\">Archivers</A></LI>\n");
|
2004-04-03 18:46:54 +00:00
|
|
|
fprintf(hp, " <LI><A HREF=\"virscan.html\">Virus Scanners</A></LI>\n");
|
2004-03-28 19:36:30 +00:00
|
|
|
fprintf(hp, " <LI><A HREF=\"modem.html\">Modem Types</A></LI>\n");
|
2004-04-03 18:46:54 +00:00
|
|
|
fprintf(hp, " <LI><A HREF=\"ttyinfo.html\">TTY Lines Info</A></LI>\n");
|
2004-03-29 19:47:14 +00:00
|
|
|
fprintf(hp, " <LI><A HREF=\"nodes.html\">Fidonet Nodes</A></LI>\n");
|
2004-03-28 15:51:29 +00:00
|
|
|
fprintf(hp, " <LI>BBS: <A HREF=\"limits.html\">Security Limits</A></LI>\n");
|
|
|
|
fprintf(hp, " <LI>BBS: <A HREF=\"language.html\">Language Setup</A></LI>\n");
|
|
|
|
fprintf(hp, " <LI>BBS: <A HREF=\"menus.html\">BBS Menus</A></LI>\n");
|
|
|
|
fprintf(hp, " <LI>BBS: <A HREF=\"fileareas.html\">File Areas</A></LI>\n");
|
2004-04-03 18:46:54 +00:00
|
|
|
fprintf(hp, " <LI>BBS: <A HREF=\"protocol.html\">Transfer Protocols</A></LI>\n");
|
2004-03-28 15:51:29 +00:00
|
|
|
fprintf(hp, " <LI>BBS: <A HREF=\"oneliners.html\">Oneliners</A></LI>\n");
|
2004-03-28 16:33:29 +00:00
|
|
|
fprintf(hp, " <LI>Mail: <A HREF=\"msggroup.html\">Echomail Groups</A></LI>\n");
|
2004-03-28 15:51:29 +00:00
|
|
|
fprintf(hp, " <LI>Mail: <A HREF=\"msgareas.html\">Echomail Areas</A></LI>\n");
|
|
|
|
fprintf(hp, " <LI>TIC: <A HREF=\"filegroup.html\">FileEcho Groups</A></LI>\n");
|
2004-04-03 18:46:54 +00:00
|
|
|
fprintf(hp, " <LI>TIC: <A HREF=\"ticareas.html\">Fileecho Areas</A></LI>\n");
|
2004-03-28 15:51:29 +00:00
|
|
|
fprintf(hp, " <LI>TIC: <A HREF=\"hatch.html\">Hatch Manager</A></LI>\n");
|
|
|
|
fprintf(hp, " <LI>TIC: <A HREF=\"magic.html\">Magic Files</A></LI>\n");
|
2004-03-28 19:36:30 +00:00
|
|
|
fprintf(hp, " <LI><A HREF=\"newgroup.html\">Newfiles Groups</A></LI>\n");
|
|
|
|
fprintf(hp, " <LI><A HREF=\"newfiles.html\">Newfiles Reports</A></LI>\n");
|
2004-03-24 22:23:21 +00:00
|
|
|
fprintf(hp, " <LI><A HREF=\"filefind.html\">Filefind Setup</A></LI>\n");
|
2004-04-03 18:46:54 +00:00
|
|
|
fprintf(hp, " <LI><A HREF=\"users.html\">BBS Users</A></LI>\n");
|
|
|
|
fprintf(hp, " <LI><A HREF=\"service.html\">Mail Service Manager</A></LI>\n");
|
2004-03-24 22:23:21 +00:00
|
|
|
fprintf(hp, " <LI><A HREF=\"domain.html\">Domain translation</A></LI>\n");
|
2004-04-03 18:46:54 +00:00
|
|
|
fprintf(hp, " <LI><A HREF=\"task.html\">Task Manager</A></LI>\n");
|
|
|
|
fprintf(hp, " <LI><A HREF=\"route.html\">Network Routing</A></LI>\n");
|
2004-03-24 22:23:21 +00:00
|
|
|
fprintf(hp, "</UL>\n");
|
|
|
|
close_webdoc(hp);
|
|
|
|
} else {
|
|
|
|
Syslog('+', "Can't create html documentation");
|
|
|
|
}
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2004-03-28 15:51:29 +00:00
|
|
|
mvprintw(8,11, (char *)"Creating site documents");
|
|
|
|
fflush(stdout);
|
|
|
|
horiz = 35;
|
2004-03-24 22:23:21 +00:00
|
|
|
page = global_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = fido_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = archive_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = virus_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = modem_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = tty_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = node_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = bbs_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = mail_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = tic_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = newf_group_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = new_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = ff_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = service_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = domain_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = task_doc(fp, toc, page);
|
2004-03-28 15:51:29 +00:00
|
|
|
dotter();
|
2004-03-24 22:23:21 +00:00
|
|
|
page = route_doc(fp, toc, page);
|
2004-03-29 20:41:26 +00:00
|
|
|
dotter();
|
2004-04-03 18:46:54 +00:00
|
|
|
users_doc();
|
|
|
|
dotter();
|
2004-03-29 20:41:26 +00:00
|
|
|
ol_doc();
|
2004-03-28 15:51:29 +00:00
|
|
|
clrtoeol();
|
2004-04-03 19:02:43 +00:00
|
|
|
mvprintw( 8,11, (char *)"Created site documents in %s/share/doc", getenv("MBSE_ROOT"));
|
2004-03-28 15:51:29 +00:00
|
|
|
fflush(stdout);
|
2004-03-24 22:23:21 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Append table of contents
|
|
|
|
*/
|
|
|
|
page = newpage(fp, page);
|
|
|
|
addtoc(fp, toc, 17, 0, page, (char *)"Table of contents");
|
|
|
|
fprintf(fp, "\n\n");
|
|
|
|
line = 4;
|
|
|
|
rewind(toc);
|
|
|
|
|
|
|
|
while (fgets(temp, 256, toc) != NULL) {
|
|
|
|
fprintf(fp, "%s", temp);
|
|
|
|
line++;
|
|
|
|
if (line == 56) {
|
|
|
|
page = newpage(fp, page);
|
|
|
|
line = 0;
|
2001-08-17 05:46:24 +00:00
|
|
|
}
|
2004-03-24 22:23:21 +00:00
|
|
|
}
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2004-03-24 22:23:21 +00:00
|
|
|
fprintf(fp, "\f");
|
|
|
|
fclose(fp);
|
|
|
|
fclose(toc);
|
|
|
|
unlink(temp1);
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2004-03-24 22:23:21 +00:00
|
|
|
Syslog('+', "Sitedocs created");
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2004-03-24 22:23:21 +00:00
|
|
|
/*
|
|
|
|
* Remove obsolete documents
|
|
|
|
*/
|
|
|
|
sprintf(temp, "%s/doc/xref.doc", getenv("MBSE_ROOT"));
|
|
|
|
unlink(temp);
|
|
|
|
sprintf(temp, "%s/doc/stat.doc", getenv("MBSE_ROOT"));
|
|
|
|
unlink(temp);
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2004-03-24 22:23:21 +00:00
|
|
|
center_addstr(LINES -4, (char *)"Press any key");
|
|
|
|
readkey(LINES -4, COLS / 2 + 8, LIGHTGRAY, BLACK);
|
|
|
|
return;
|
2001-08-17 05:46:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-10-19 14:25:14 +00:00
|
|
|
void initdatabases(void)
|
|
|
|
{
|
2001-10-25 11:14:57 +00:00
|
|
|
if (!init) {
|
|
|
|
clr_index();
|
|
|
|
working(1, 0, 0);
|
|
|
|
set_color(WHITE, BLACK);
|
|
|
|
mvprintw( 5, 6, " INIT DATABASES");
|
|
|
|
IsDoing("Init Databases");
|
|
|
|
}
|
|
|
|
|
2001-10-19 21:10:43 +00:00
|
|
|
config_read();
|
|
|
|
|
2001-10-19 14:25:14 +00:00
|
|
|
InitArchive();
|
|
|
|
InitDomain();
|
|
|
|
InitFilearea();
|
|
|
|
InitFilefind();
|
|
|
|
InitFGroup();
|
2001-10-19 21:10:43 +00:00
|
|
|
InitFidonetdb();
|
2004-04-29 19:25:14 +00:00
|
|
|
InitFidonet();
|
2001-10-19 21:10:43 +00:00
|
|
|
InitHatch();
|
|
|
|
InitLanguage();
|
|
|
|
InitLimits();
|
|
|
|
InitMagics();
|
|
|
|
InitMsgarea();
|
|
|
|
InitMGroup();
|
|
|
|
InitModem();
|
|
|
|
InitNewfiles();
|
|
|
|
InitNGroup();
|
|
|
|
InitNodes();
|
|
|
|
InitOneline();
|
2002-05-05 17:34:07 +00:00
|
|
|
InitBBSlist();
|
2001-10-19 21:10:43 +00:00
|
|
|
InitProtocol();
|
|
|
|
InitService();
|
|
|
|
InitTicarea();
|
|
|
|
InitTtyinfo();
|
|
|
|
InitUsers();
|
|
|
|
InitVirus();
|
2002-07-16 21:05:00 +00:00
|
|
|
InitRoute();
|
2004-03-06 21:48:41 +00:00
|
|
|
InitFDB();
|
2001-10-19 14:25:14 +00:00
|
|
|
|
2001-10-25 11:14:57 +00:00
|
|
|
if (!init) {
|
|
|
|
clr_index();
|
|
|
|
}
|
2001-10-19 14:25:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-08-17 05:46:24 +00:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2003-08-03 14:08:07 +00:00
|
|
|
int loop = 1;
|
|
|
|
struct passwd *pw;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Find out who is on the keyboard or automated the keyboard.
|
|
|
|
*/
|
|
|
|
pw = getpwuid(geteuid());
|
|
|
|
if (strcmp(pw->pw_name, (char *)"mbse")) {
|
|
|
|
printf("ERROR: only user \"mbse\" may use this program\n");
|
|
|
|
exit(MBERR_INIT_ERROR);
|
|
|
|
}
|
2001-10-25 11:14:57 +00:00
|
|
|
|
2003-08-03 14:08:07 +00:00
|
|
|
/*
|
|
|
|
* Read the global configuration data, registrate connection
|
|
|
|
*/
|
|
|
|
config_check(getenv("MBSE_ROOT"));
|
|
|
|
config_read();
|
2003-09-09 19:39:51 +00:00
|
|
|
if (strlen(CFG.debuglog) == 0)
|
|
|
|
sprintf(CFG.debuglog, "debug.log");
|
|
|
|
InitClient(pw->pw_name, (char *)"mbsetup", CFG.location, CFG.logfile, 0x1f, CFG.error_log, CFG.mgrlog, CFG.debuglog);
|
2003-08-03 14:08:07 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Setup several signals so when the program terminate's it
|
|
|
|
* will properly close the curses screens.
|
|
|
|
*/
|
|
|
|
signal(SIGINT, (void (*))die);
|
|
|
|
signal(SIGBUS, (void (*))die);
|
|
|
|
signal(SIGSEGV,(void (*))die);
|
|
|
|
signal(SIGTERM,(void (*))die);
|
|
|
|
signal(SIGKILL,(void (*))die);
|
|
|
|
|
|
|
|
oldmask = umask(002);
|
|
|
|
|
|
|
|
do_quiet = TRUE;
|
|
|
|
Syslog(' ', " ");
|
|
|
|
Syslog(' ', "MBSETUP v%s started by %s", VERSION, pw->pw_name);
|
|
|
|
if (init)
|
|
|
|
Syslog('+', "Cmd: mbsetup init");
|
|
|
|
|
2004-03-11 18:58:51 +00:00
|
|
|
if ((argc == 2) && (strncmp(tl(argv[1]), "i", 1) == 0))
|
|
|
|
init = TRUE;
|
|
|
|
else
|
|
|
|
screen_start((char *)"MBsetup");
|
|
|
|
|
2003-08-03 14:08:07 +00:00
|
|
|
if (lockprogram((char *)"mbsetup")) {
|
|
|
|
printf("\n\7Another mbsetup is already running, abort.\n\n");
|
|
|
|
die(MBERR_NO_PROGLOCK);
|
|
|
|
}
|
|
|
|
|
|
|
|
bbs_free = FALSE;
|
|
|
|
initdatabases();
|
2001-10-19 14:25:14 +00:00
|
|
|
|
2003-08-03 14:08:07 +00:00
|
|
|
if (!init) {
|
|
|
|
do {
|
|
|
|
IsDoing("Browsing Menu");
|
|
|
|
clr_index();
|
|
|
|
set_color(WHITE, BLACK);
|
|
|
|
mvprintw( 5, 6, "0. MAIN SETUP");
|
|
|
|
set_color(CYAN, BLACK);
|
|
|
|
mvprintw( 7, 6, "1. Edit Global configuration");
|
|
|
|
mvprintw( 8, 6, "2. Edit Fido Networks");
|
|
|
|
mvprintw( 9, 6, "3. Edit Archiver Programs");
|
|
|
|
mvprintw(10, 6, "4. Edit Virus Scanners");
|
|
|
|
mvprintw(11, 6, "5. Edit Modem types");
|
|
|
|
mvprintw(12, 6, "6. Edit TTY lines info");
|
|
|
|
mvprintw(13, 6, "7. Edit Fidonet Nodes");
|
|
|
|
mvprintw(14, 6, "8. Edit BBS Setup");
|
|
|
|
mvprintw(15, 6, "9. Edit Mail Setup");
|
|
|
|
mvprintw(16, 6, "10. Edit File Echo's setup");
|
|
|
|
mvprintw(17, 6, "11. Edit Newfiles Groups");
|
|
|
|
mvprintw( 7,46, "12. Edit Newfiles Reports");
|
|
|
|
mvprintw( 8,46, "13. Edit FileFind Setup");
|
|
|
|
mvprintw( 9,46, "14. Edit Files Database");
|
|
|
|
mvprintw(10,46, "15. Edit BBS Users");
|
|
|
|
mvprintw(11,46, "16. Edit Services");
|
|
|
|
mvprintw(12,46, "17. Edit Domains");
|
|
|
|
mvprintw(13,46, "18. Edit Task Manager");
|
|
|
|
mvprintw(14,46, "19. Edit Routing Table");
|
|
|
|
mvprintw(15,46, "20. Show software information");
|
|
|
|
mvprintw(16,46, "21. Create site documents");
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2003-08-03 14:08:07 +00:00
|
|
|
switch(select_menu(21)) {
|
2001-08-17 05:46:24 +00:00
|
|
|
case 0:
|
|
|
|
loop = 0;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
global_menu();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
EditFidonet();
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
EditArchive();
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
EditVirus();
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
EditModem();
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
EditTtyinfo();
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
EditNodes();
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
bbs_menu();
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
mail_menu();
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
tic_menu();
|
|
|
|
break;
|
|
|
|
case 11:
|
|
|
|
EditNGroup();
|
|
|
|
break;
|
|
|
|
case 12:
|
|
|
|
EditNewfiles();
|
|
|
|
break;
|
|
|
|
case 13:
|
|
|
|
EditFilefind();
|
|
|
|
break;
|
|
|
|
case 14:
|
|
|
|
EditFDB();
|
|
|
|
break;
|
|
|
|
case 15:
|
|
|
|
EditUsers();
|
|
|
|
break;
|
|
|
|
case 16:
|
|
|
|
EditService();
|
|
|
|
break;
|
|
|
|
case 17:
|
|
|
|
EditDomain();
|
|
|
|
break;
|
|
|
|
case 18:
|
|
|
|
task_menu();
|
|
|
|
break;
|
|
|
|
case 19:
|
2002-07-16 21:05:00 +00:00
|
|
|
EditRoute();
|
2001-08-17 05:46:24 +00:00
|
|
|
break;
|
|
|
|
case 20:
|
2002-07-16 21:05:00 +00:00
|
|
|
soft_info();
|
|
|
|
break;
|
|
|
|
case 21:
|
2001-08-17 05:46:24 +00:00
|
|
|
site_docs();
|
|
|
|
break;
|
2003-08-03 14:08:07 +00:00
|
|
|
}
|
|
|
|
} while (loop == 1);
|
|
|
|
}
|
2001-08-17 05:46:24 +00:00
|
|
|
|
2003-08-03 14:08:07 +00:00
|
|
|
die(MBERR_OK);
|
|
|
|
return 0;
|
2001-08-17 05:46:24 +00:00
|
|
|
}
|
|
|
|
|