UnrealIRCd Conf File Generator

By miniCruzer on May 16, 2010

This is a fully functional UnrealIRCd Server file generator (unrealircd.conf). It does not, however, include services.

If you do not know how to set up a configuration file, you should not run an auto-conf. I use this script when I set up my own servers when I'm too lazy to do it by hand.

I thought I would post this here to see if anyone has any suggestions. This can be run from any directory, but it will erase any file named 'unrealircd.conf' in the same directory as itself. This is due to people who may run the script more than once and overwrite.

#!/usr/bin/perl -w
# UnrealIRCd 3.2.x Configuration File Generator
# Run from the root directory of UnrealIRCd (usuall ~/Unreal3.2)
# E-Mail bugs/suggestions to miniCruzer@InsaneIRC.com
use Term::ANSIColor;
$ConfFile = "unrealircd.conf";
unlink $ConfFile;
system("clear");
print color 'bold blue';
print " _    _                      _ _____ _____   _____    _ \n";
print "| |  | |                    | |_   _|  __ \\ / ____|  | |\n";
print "| |  | |_ __  _ __ ___  __ _| | | | | |__) | |     __| |\n";
print "| |  | | '_ \\| '__/ _ \\\/ _` | | | | |  _  \/| |    / _` |\n";
print "| |__| | | | | | |  __/ (_| | |_| |_| | \\ \\| |___| (_| |\n";
print " \\____/|_| |_|_|  \\___|\\__,_|_|_____|_|  \\_\\\\_____\\__,_|\n";
print color 'reset';
print color 'bold';
print "This is an auto-conf generator script for Unreal 3.2.\n";
print "Run this from the root of UnrealIRCd (usually ~\/Unreal3.2)\n";
print "Warning: If you have a pre-exisiting unrealircd.conf in this\n";
print "directory, it has been deleted.\n";
print "**********************************************************\n";
print "IP for IRCd to bind on. [Required]\n";
$BindIP = <STDIN>;
chomp($BindIP);
print "Network name. [Required]\n";
$NetName = <STDIN>;
chomp($BindIP);
print "Full network address. [Required]\n";
$NetAddress = <STDIN>;
chomp($NetAddress);
print "Server name. [Required]\n";
$ServName = <STDIN>;
chomp($ServName);
print "Your resolved hostname. (Example: *\@*.dhcp.insightbb.com) [Recommended]\n";
$MyHost = <STDIN>;
chomp($MyHost);
print "Email address. [Required]\n";
$MyEmail = <STDIN>;
chomp($MyEmail);
print "Your nickname. [Required]\n";
$MyNick = <STDIN>;
chomp($MyNick);
print "Main network channel [Recommended]\n";
$MainChan = <STDIN>;
chomp($MainChan);
print "Network help channel. [Recommended]\n";
$HelpChan = <STDIN>;
chomp($HelpChan);
print "Address of services your server is using. (Example: services.$NetAddress) [Required]\n";
$Services = <STDIN>;
chomp($Services);
print "Default network server. [Optional]\n";
$DefServ = <STDIN>;
chomp($DefServ);
print "Address of stats your server is using. (Example. stats.$NetAddress) [Optional]\n";
$Stats = <STDIN>;
chomp($Stats);
print "Password to be used to oper-up and shutdown or restart the IRCd. [Required]\n";
$MyPass = <STDIN>;
chomp($MyPass);
open (UNREALCONF, '>>unrealircd.conf');
print UNREALCONF "cgiirc {\n";
print UNREALCONF "       type webirc;\n";
print UNREALCONF "       hostname 64.62.228.82;\n";
print UNREALCONF "       password password;\n";
print UNREALCONF "};\n";
print UNREALCONF "\n";
print UNREALCONF "cgiirc {\n";
print UNREALCONF "       type webirc;\n";
print UNREALCONF "       hostname 207.192.75.252;\n";
print UNREALCONF "       password password;\n";
print UNREALCONF "};\n";
print UNREALCONF "loadmodule \"src/modules/commands.so\";\n";
print UNREALCONF "loadmodule \"src/modules/cloak.so\";\n";
print UNREALCONF "include \"help.conf\";\n";
print UNREALCONF "include \"badwords.channel.conf\";\n";
print UNREALCONF "include \"badwords.message.conf\";\n";
print UNREALCONF "include \"badwords.quit.conf\";\n";
print UNREALCONF "include \"spamfilter.conf\";\n";
print UNREALCONF "include \"aliases/anope.conf\";\n";
print UNREALCONF "me\n";
print UNREALCONF "{\n";
print UNREALCONF "  name \"$ServName\";\n";
print UNREALCONF "  info \"$NetName Client Server\";\n";
print UNREALCONF "  numeric 32;\n";
print UNREALCONF "};\n";
print UNREALCONF "\n";
print UNREALCONF "admin {\n";
print UNREALCONF "  \"$NetName Server\";\n";
print UNREALCONF "  \"Server Channel: $MainChan\";\n";
print UNREALCONF "  \"Help Channel: $HelpChan\";\n";
print UNREALCONF "        \"Server Administrator(s): $MyNick\";\n";
print UNREALCONF "};\n";
print UNREALCONF "class           clients\n";
print UNREALCONF "{\n";
print UNREALCONF "  pingfreq 90;\n";
print UNREALCONF "  maxclients 500;\n";
print UNREALCONF "  sendq 100000;\n";
print UNREALCONF "  recvq 8000;\n";
print UNREALCONF "};\n";
print UNREALCONF "class           servers\n";
print UNREALCONF "{\n";
print UNREALCONF "  pingfreq 90;\n";
print UNREALCONF "  maxclients 10;  \n";
print UNREALCONF "  sendq 1000000;\n";
print UNREALCONF "  connfreq 100;\n";
print UNREALCONF "};\n";
print UNREALCONF "allow {\n";
print UNREALCONF "  ip             *@*;\n";
print UNREALCONF "  hostname       *@*;\n";
print UNREALCONF "  class           clients;\n";
print UNREALCONF "  maxperip 5;\n";
print UNREALCONF "};\n";
print UNREALCONF "listen          $BindIP:6697 { options { ssl; clientsonly; }; };\n";
print UNREALCONF "listen          $BindIP:55401 { options { ssl; serversonly; }; };\n";
print UNREALCONF "listen          $BindIP:6660-6669 { options { clientsonly; }; };\n";
print UNREALCONF "listen          $BindIP:7002 { options { serversonly; }; };\n";
print UNREALCONF "ulines {\n";
print UNREALCONF "  $Services;\n";
print UNREALCONF "};\n";
print UNREALCONF "drpass { restart \"$MyPass\"; die \"$MyPass\"; };\n";
print UNREALCONF "log \"ircd.log\" {\n";
print UNREALCONF "  maxsize 2097152;\n";
print UNREALCONF "  flags {\n";
print UNREALCONF "      oper;\n";
print UNREALCONF "      kline;\n";
print UNREALCONF "      connects;\n";
print UNREALCONF "      server-connects;\n";
print UNREALCONF "      kills;\n";
print UNREALCONF "      errors;\n";
print UNREALCONF "      sadmin-commands;\n";
print UNREALCONF "      chg-commands;\n";
print UNREALCONF "      oper-override;\n";
print UNREALCONF "      spamfilter;\n";
print UNREALCONF "  };\n";
print UNREALCONF "};\n";
print UNREALCONF "tld {\n";
print UNREALCONF "  mask *@*;\n";
print UNREALCONF "  motd \"ircd.motd\";\n";
print UNREALCONF "  rules \"ircd.rules\";\n";
print UNREALCONF "};\n";
print UNREALCONF "except ban {\n";
print UNREALCONF "  mask           *\@*.dhcp.insightbb.com;\n";
print UNREALCONF "};\n";
print UNREALCONF "set {\n";
print UNREALCONF "  network-name        \"$NetName\";\n";
print UNREALCONF "  default-server      \"$DefServ\";\n";
print UNREALCONF "  services-server     \"$Services\";\n";
print UNREALCONF "  stats-server        \"$Stats\";\n";
print UNREALCONF "  help-channel        \"$HelpChan\";\n";
print UNREALCONF "  hiddenhost-prefix   \"$NetName\";\n";
print UNREALCONF "  cloak-keys {\n";
print UNREALCONF "      \"scgh437ygvb436u4on3pioj6pnt5yh3p4oj45pOJ\";\n";
print UNREALCONF "      \"OBNopi4ni3opjPOJNopj345j2ponpoPOJplj34pn\";\n";
print UNREALCONF "      \"oiJIOPJNPOj234pojpoj324opknpnPOJpojpdxfa\";\n";
print UNREALCONF "  };\n";
print UNREALCONF "  hosts {\n";
print UNREALCONF "      local       \"local.$NetAddress\";\n";
print UNREALCONF "      global      \"global.$NetAddress\";\n";
print UNREALCONF "      coadmin     \"coadmin.$NetAddress\";\n";
print UNREALCONF "      admin       \"admin.$NetAddress\";\n";
print UNREALCONF "      servicesadmin   \"techadmin.$NetAddress\";\n";
print UNREALCONF "      netadmin    \"netadmin.$NetAddress\";\n";
print UNREALCONF "      host-on-oper-up \"yes\";\n";
print UNREALCONF "  };\n";
print UNREALCONF "  kline-address \"$MyEmail\";\n";
print UNREALCONF "  gline-address \"$MyEmail\";\n";
print UNREALCONF "  modes-on-connect \"+ixw\";\n";
print UNREALCONF "  modes-on-oper    \"+Wxwgspq\";\n";
print UNREALCONF "  snomask-on-oper \"+cFfkejvGnNqsSo\";\n";
print UNREALCONF "  restrict-usermodes \"iwx\";\n";
print UNREALCONF "  oper-auto-join \"$MainChan,$HelpChan,\#Services,\#Opers\";\n";
print UNREALCONF "  options {\n";
print UNREALCONF "      flat-map;\n";
print UNREALCONF "      hide-ulines;\n";
print UNREALCONF "      show-opermotd;\n";
print UNREALCONF "      allow-part-if-shunned;\n";
print UNREALCONF "      fail-oper-warn;\n";
print UNREALCONF "      show-connect-info;\n";
print UNREALCONF "  };\n";
print UNREALCONF "  maxchannelsperuser 10;\n";
print UNREALCONF "  anti-spam-quit-message-time 10s;\n";
print UNREALCONF "  oper-only-stats \"*\";\n";
print UNREALCONF "  throttle {\n";
print UNREALCONF "      connections 3;\n";
print UNREALCONF "      period 60s;\n";
print UNREALCONF "  };\n";
print UNREALCONF "  anti-flood {\n";
print UNREALCONF "      nick-flood 3:60;\n";
print UNREALCONF "  };\n";
print UNREALCONF "  spamfilter {\n";
print UNREALCONF "      ban-time 1d;\n";
print UNREALCONF "      ban-reason \"Spam\/Advertising\";\n";
print UNREALCONF "      virus-help-channel \"$HelpChan\";\n";
print UNREALCONF "      except \"#help\";\n";
print UNREALCONF "  };\n";
print UNREALCONF "};\n";
print UNREALCONF "ban realname {\n";
print UNREALCONF "  mask \"wIRC-client\";\n";
print UNREALCONF "  reason \"Do not attempt to use wIRC here.\";\n";
print UNREALCONF "};\n";
print UNREALCONF "except tkl {\n";
print UNREALCONF "  mask $MyHost;\n";
print UNREALCONF "  type { gline; gzline; qline; gqline; shun; };\n";
print UNREALCONF "};\n";
print UNREALCONF "except tkl { mask *@72.64.145.20; type { gline; gzline; qline; gqline; shun; }; };\n";
print UNREALCONF "except ban { mask *@72.64.145.20; };\n";
print UNREALCONF "except tkl { mask *@*.server4you.de; type { gline; gzline; qline; gqline; shun; }; };\n";
print UNREALCONF "except ban { mask *@*.server4you.de; };\n";
print UNREALCONF "oper $MyNick {\n";
print UNREALCONF "        class           clients;\n";
print UNREALCONF "        from {\n";
print UNREALCONF "                userhost $MyHost;\n";
print UNREALCONF "        };\n";
print UNREALCONF "        password \"$MyPass\";\n";
print UNREALCONF "        flags\n";
print UNREALCONF "        {\n";
print UNREALCONF "                netadmin;\n";
print UNREALCONF "                can_rehash;\n";
print UNREALCONF "                can_die;\n";
print UNREALCONF "                can_restart;\n";
print UNREALCONF "                helpop;\n";
print UNREALCONF "                can_wallops;\n";
print UNREALCONF "                can_globops;\n";
print UNREALCONF "                can_localroute;\n";
print UNREALCONF "                can_globalroute;\n";
print UNREALCONF "                can_localkill;\n";
print UNREALCONF "                can_globalkill;\n";
print UNREALCONF "                can_kline;\n";
print UNREALCONF "                can_gkline;\n";
print UNREALCONF "                can_unkline;\n";
print UNREALCONF "                can_localnotice;\n";
print UNREALCONF "                can_globalnotice;\n";
print UNREALCONF "                can_zline;\n";
print UNREALCONF "                can_gzline;\n";
print UNREALCONF "                get_umodew;\n";
print UNREALCONF "                get_host;\n";
print UNREALCONF "                can_override;\n";
print UNREALCONF "                can_setq;\n";
print UNREALCONF "                can_addline;\n";
print UNREALCONF "                can_dccdeny;\n";
print UNREALCONF "         };\n";
print UNREALCONF "        snomask cFfkejvGnNqsSoJ;\n";
print UNREALCONF "        modes WqHp;\n";
print UNREALCONF "        swhois \"$NetName NetAdmin\"\n";
print UNREALCONF "};\n";
close (UNREALCONF);

Comments

Sign in to comment.
RaZ   -  Jan 13, 2011

woww Great scriptttt thanks

 Respond  
Aubrey   -  Jan 13, 2011

Looks good, although I would suggest adding a simple check to see if the user really wants to add a generic webirc block for mibbit, even one that won't work. As well, exempting searchIRC is annoying because no one likes it, and I'm not entirely sure why the server4you.de is exempted from every ban however those are more opinion issues and not a specific code issue.

 Respond  
mitch21236   -  Aug 26, 2010

Ugh, Great Script, But i could've used it a few days ago, Lol.

 Respond  
SimplicityX   -  Aug 24, 2010

Looks nice, miniCruzer. I have not tested it personally -- I have no need for it. But I am learning Perl.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.