/* -TAG:LICENSE-
   
   This file is under the DigitalSpark Freeware Class License, see the
   file LICENSE for complete licensing information.
                                                         
                                                         -TAG:LICENSE- */
#include <Threading.h>
#include "tricky.h"

void FirstRun( void )
{
FILE	*out;

Error(0,"Creating ~/.trickyirc ...");
system("mkdir ~/.trickyirc");
Error(0,"Creating ~/.trickyirc/logs/ ...");
system("mkdir ~/.trickyirc/logs");
Error(0,"Creating ~/.trickyirc/config ...");

sprintf(ConfigFilePath,"%s/.trickyirc/config",getenv("HOME"));
if ( (out = fopen(ConfigFilePath,"w")) == NULL )
   {
   Error(2,"Couldn't write config file template.");
   sleep(1);
   exit(1);
   }

fputs("[Arbiter]\r\n",out);
fputs("ListenPort=		7667\r\n",out);
fputs("AuthPhrase=		password\r\n",out);
fputs("\r\n",out);
fputs("[Servers]\r\n",out);
fputs("irc.server1.net		6667\r\n",out);
fputs("irc.server2.net		6667\r\n",out);
fputs("irc.server3.net		6667\r\n",out);

fclose(out);
}

