Advertisement
Guest User

InspIRCd 2.0 Configuration File Generator

a guest
Jun 26th, 2010
1,263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 11.54 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2. # InspIRCd 2.0 Configuration File Generator
  3. # Run from run/conf in your InspIRCd directory.
  4. # E-Mail bugs/suggestions to miniCruzer@InsaneIRC.com
  5. use Term::ANSIColor;
  6. print color 'bold blue';
  7. @ConfFiles = ("inspircd.conf","opers.conf","links.conf","modules.conf");
  8. unlink @ConfFiles;
  9. system("rm -rf *.example");
  10. system("clear");
  11. print "               ___                ___ ____   ____    _                \n";
  12. print "              |_ _|_ __  ___ _ __|_ _|  _ \\ / ___|__| |               \n";
  13. print "               | || '_ \\/ __| '_ \\| || |_) | |   / _` |               \n";
  14. print "               | || | | \\__ \\ |_) | ||  _ <| |__| (_| |               \n";
  15. print "              |___|_| |_|___/ .__/___|_| \\_\\\\____\\__,_|               \n";
  16. print "                            |_|                                       \n";
  17. print "      ____             __ _                       _   _               \n";
  18. print "     / ___|___  _ __  / _(_) __ _ _   _ _ __ __ _| |_(_) ___  _ __    \n";
  19. print "    | |   / _ \\| '_ \\| |_| |/ _` | | | | '__/ _` | __| |/ _ \\| '_ \\   \n";
  20. print "    | |__| (_) | | | |  _| | (_| | |_| | | | (_| | |_| | (_) | | | |  \n";
  21. print "     \\____\\___/|_| |_|_| |_|\\__, |\\__,_|_|  \\__,_|\\__|_|\\___/|_| |_|  \n";
  22. print "                            |___/                                       \n";
  23. print color 'reset';
  24. print color 'bold';
  25. print "This is an auto-conf for InspIRCd2.0\n";
  26. print "You must run this from run\/conf of your InspIRCd directory.\n";
  27. print "Filling in incorrect information will result in a broken IRCd.\n";
  28. print "Please do not make up information.\n";
  29. print "*************************************************************\n";
  30. print "Please input the IP your IRCd will run on. [Required]\n";
  31. $bindip = <STDIN>;
  32. chomp($bindip);
  33. print "Please input the name of your IRC Network. [Required]\n";
  34. $NetName = <STDIN>;
  35. chomp($NetName);
  36. print "Please input your network address. ($NetName.com/.org/.net) [Required]\n";
  37. $NetAddress = <STDIN>;
  38. chomp($NetAddress);
  39. print "Please input your server name. [Required]\n";
  40. $ServName = <STDIN>;
  41. chomp($ServName);
  42. print "Please input YOUR resolved hostname. (Example: *@*.dhcp.insightbb.com). [Recommended]\n";
  43. $MyHost = <STDIN>;
  44. chomp($MyHost);
  45. print "Please input your email address. [Optional]\n";
  46. $MyEmail = <STDIN>;
  47. chomp($MyEmail);
  48. print "Please input your full name. [Optional]\n";
  49. $MyName = <STDIN>;
  50. chomp($MyName);
  51. print "Please input your IRC Nickname. [Recommended]\n";
  52. $MyNick = <STDIN>;
  53. chomp($MyNick);
  54. print "Please input a password to use (this will be used to oper up, and restart\/kill the IRCd.) [REQUIRED]\n";
  55. $MyPass = <STDIN>;
  56. chomp($MyPass);
  57. open (INSPIRCDCONF, '>>inspircd.conf');
  58. print INSPIRCDCONF "# Executable Include Example:\n";
  59. print INSPIRCDCONF "#<include executable=\"\/usr\/bin\/wget -q -O - http:\/\/$NetName.com\/inspircd.conf\">\n";
  60. print INSPIRCDCONF "<config format=\"xml\">\n";
  61. print INSPIRCDCONF "<define name=\"bindip\" value=\"1.2.\">\n";
  62. print INSPIRCDCONF "<server\n";
  63. print INSPIRCDCONF "        name=\"$ServName\"\n";
  64. print INSPIRCDCONF "        description=\"$NetName Client Server\"\n";
  65. print INSPIRCDCONF "        network=\"$NetName\">\n";
  66. print INSPIRCDCONF "<admin\n";
  67. print INSPIRCDCONF "       name=\"$MyName\"\n";
  68. print INSPIRCDCONF "       nick=\"$MyNick\"\n";
  69. print INSPIRCDCONF "       email=\"$MyEmail\">\n";
  70. print INSPIRCDCONF "<bind address=\"$bindip\" port=\"6660-6669\" type=\"clients\">\n";
  71. print INSPIRCDCONF "<bind address=\"$bindip\" port=\"7252\" type=\"servers\" ssl=\"openssl\">\n";
  72. print INSPIRCDCONF "<bind address=\"$bindip\" port=\"4400\" type=\"servers\">\n";
  73. print INSPIRCDCONF "<bind address=\"$bindip\" port=\"+7000,6697,9999\" type=\"clients\" ssl=\"openssl\">\n";
  74. print INSPIRCDCONF "<power\n";
  75. print INSPIRCDCONF "       diepass=\"$MyPass\"\n";
  76. print INSPIRCDCONF "       restartpass=\"$MyPass\">\n";
  77. print INSPIRCDCONF "<connect\n";
  78. print INSPIRCDCONF "         name=\"main\"\n";
  79. print INSPIRCDCONF "         allow=\"*\"\n";
  80. print INSPIRCDCONF "         timeout=\"10\"\n";
  81. print INSPIRCDCONF "         pingfreq=\"120\"\n";
  82. print INSPIRCDCONF "         hardsendq=\"3048576\"\n";
  83. print INSPIRCDCONF "         softsendq=\"1118192\"\n";
  84. print INSPIRCDCONF "         recvq=\"12318192\"\n";
  85. print INSPIRCDCONF "         threshold=\"10\"\n";
  86. print INSPIRCDCONF "         commandrate=\"1000\"\n";
  87. print INSPIRCDCONF "         fakelag=\"on\"\n";
  88. print INSPIRCDCONF "         localmax=\"3\"\n";
  89. print INSPIRCDCONF "         globalmax=\"3\"\n";
  90. print INSPIRCDCONF "         useident=\"no\"\n";
  91. print INSPIRCDCONF "         limit=\"5000\"\n";
  92. print INSPIRCDCONF "         modes=\"+ix\">\n";
  93. print INSPIRCDCONF "<cidr\n";
  94. print INSPIRCDCONF "      ipv4clone=\"32\"\n";
  95. print INSPIRCDCONF "      ipv6clone=\"128\">\n";
  96. print INSPIRCDCONF "<include file=\"conf\/opers.conf\">\n";
  97. print INSPIRCDCONF "<include file=\"conf\/links.conf\">\n";
  98. print INSPIRCDCONF "<files motd=\"conf\/inspircd.motd\" rules=\"conf/inspircd.rules\">\n";
  99. print INSPIRCDCONF "#<execfiles rules=\"wget -O - http:\/\/www.example.com\/rules.txt\">\n";
  100. print INSPIRCDCONF "<channels users=\"20\" opers=\"60\">\n";
  101. print INSPIRCDCONF "<banlist chan=\"#morons\" limit=\"128\">\n";
  102. print INSPIRCDCONF "<banlist chan=\"*\" limit=\"69\">\n";
  103. print INSPIRCDCONF "<disabled commands=\"KILL GLINE ZLINE KLINE SQUIT TLINE QLINE\" usermodes=\"\" chanmodes=\"O\" fakenonexistant=\"yes\">\n";
  104. print INSPIRCDCONF "<options\n";
  105. print INSPIRCDCONF "         prefixquit=\"Quit: \"\n";
  106. print INSPIRCDCONF "         suffixquit=\"\"\n";
  107. print INSPIRCDCONF "         prefixpart=\"&quot;\"\n";
  108. print INSPIRCDCONF "         suffixpart=\"&quot;\"\n";
  109. print INSPIRCDCONF "         syntaxhints=\"yes\"\n";
  110. print INSPIRCDCONF "         cyclehosts=\"yes\"\n";
  111. print INSPIRCDCONF "        ircumsgprefix=\"no\"\n";
  112. print INSPIRCDCONF "         announcets=\"yes\"\n";
  113. print INSPIRCDCONF "     allowmismatched=\"no\"\n";
  114. print INSPIRCDCONF "     defaultbind=\"auto\"\n";
  115. print INSPIRCDCONF "         hostintopic=\"yes\"\n";
  116. print INSPIRCDCONF "         pingwarning=\"15\"\n";
  117. print INSPIRCDCONF "         serverpingfreq=\"60\"\n";
  118. print INSPIRCDCONF "         defaultmodes=\"nt\"\n";
  119. print INSPIRCDCONF "         moronbanner=\"You\'re banned! Email $MyEmail with the ERROR line below for help.\"\n";
  120. print INSPIRCDCONF "     exemptchanops=\"nonick:v flood:o\"\n";
  121. print INSPIRCDCONF "         invitebypassmodes=\"yes\">\n";
  122. print INSPIRCDCONF "<performance\n";
  123. print INSPIRCDCONF "             netbuffersize=\"10240\"\n";
  124. print INSPIRCDCONF "             maxwho=\"4096\"\n";
  125. print INSPIRCDCONF "             somaxconn=\"128\"\n";
  126. print INSPIRCDCONF "             softlimit=\"12800\"\n";
  127. print INSPIRCDCONF "             quietbursts=\"yes\"\n";
  128. print INSPIRCDCONF "             nouserdns=\"no\">\n";
  129. print INSPIRCDCONF "<security\n";
  130. print INSPIRCDCONF "          announceinvites=\"dynamic\"\n";
  131. print INSPIRCDCONF "          hidemodes=\"eI\"\n";
  132. print INSPIRCDCONF "          hideulines=\"yes\"\n";
  133. print INSPIRCDCONF "          flatlinks=\"yes\"\n";
  134. print INSPIRCDCONF "          hidebans=\"yes\"\n";
  135. print INSPIRCDCONF "          hidekills=\"Disconnected\"\n";
  136. print INSPIRCDCONF "          hidesplits=\"no\"\n";
  137. print INSPIRCDCONF "          maxtargets=\"20\"\n";
  138. print INSPIRCDCONF "          customversion=\"$NetName\"\n";
  139. print INSPIRCDCONF "          operspywhois=\"yes\"\n";
  140. print INSPIRCDCONF "          restrictbannedusers=\"yes\"\n";
  141. print INSPIRCDCONF "          genericoper=\"no\"\n";
  142. print INSPIRCDCONF "          userstats=\"GZKsfqPu\">\n";
  143. print INSPIRCDCONF "<limits\n";
  144. print INSPIRCDCONF "        maxnick=\"40\"\n";
  145. print INSPIRCDCONF "        maxchan=\"64\"\n";
  146. print INSPIRCDCONF "        maxmodes=\"20\"\n";
  147. print INSPIRCDCONF "        maxident=\"11\"\n";
  148. print INSPIRCDCONF "        maxquit=\"255\"\n";
  149. print INSPIRCDCONF "        maxtopic=\"307\"\n";
  150. print INSPIRCDCONF "        maxkick=\"255\"\n";
  151. print INSPIRCDCONF "        maxgecos=\"128\"\n";
  152. print INSPIRCDCONF "        maxaway=\"200\">\n";
  153. print INSPIRCDCONF "<log method=\"file\" type=\"*\" level=\"default\" target=\"ircd.log\">\n";
  154. print INSPIRCDCONF "<whowas groupsize=\"10\" maxgroups=\"100000\" maxkeep=\"3d\">\n";
  155. print INSPIRCDCONF "<badnick nick=\"ChanServ\" reason=\"Reserved For Services\">\n";
  156. print INSPIRCDCONF "<badnick nick=\"NickServ\" reason=\"Reserved For Services\">\n";
  157. print INSPIRCDCONF "<badnick nick=\"OperServ\" reason=\"Reserved For Services\">\n";
  158. print INSPIRCDCONF "<badnick nick=\"MemoServ\" reason=\"Reserved For Services\">\n";
  159. print INSPIRCDCONF "<exception host=\"$MyHost\" reason=\"$MyNick\">\n";
  160. print INSPIRCDCONF "<insane\n";
  161. print INSPIRCDCONF "        hostmasks=\"no\"\n";
  162. print INSPIRCDCONF "        ipmasks=\"no\"\n";
  163. print INSPIRCDCONF "        nickmasks=\"no\"\n";
  164. print INSPIRCDCONF "        trigger=\"95.5\">\n";
  165. print INSPIRCDCONF "<include file=\"conf\/modules.conf\">\n";
  166. close (INSPIRCDCONF);
  167. open (OPERSCONF, '>>opers.conf');
  168. print OPERSCONF "<class name=\"Everything\" commands=\"*\" privs=\"*\" usermodes=\"*\" chanmodes=\"*\">\n";
  169. print OPERSCONF "<class name=\"Shutdown\"\n";
  170. print OPERSCONF "     commands=\"DIE RESTART REHASH LOADMODULE UNLOADMODULE RELOAD GUNLOADMODULE GRELOADMODULE SAJOIN SAPART SANICK SAQUIT SATOPIC\"\n";
  171. print OPERSCONF "     privs=\"users\/auspex channels\/auspex servers\/auspex users\/mass-message channels\/high-join-limit channels\/set-permanent users\/flood/no-throttle users\/flood\/increased-buffers\"\n";
  172. print OPERSCONF "     usermodes=\"*\"\n";
  173. print OPERSCONF "     chanmodes=\"*\">\n";
  174. print OPERSCONF "<class name=\"ServerLink\" commands=\"CONNECT SQUIT CONNECT MKPASSWD ALLTIME SWHOIS CLOSE JUMPSERVER LOCKSERV\" usermodes=\"*\" chanmodes=\"*\" privs=\"servers\/auspex\">\n";
  175. print OPERSCONF "<class name=\"BanControl\" commands=\"KILL GLINE KLINE ZLINE QLINE ELINE TLINE RLINE CHECK NICKLOCK SHUN CLONES CBAN\" usermodes=\"*\" chanmodes=\"*\">\n";
  176. print OPERSCONF "<class name=\"OperChat\" commands=\"WALLOPS GLOBOPS SETIDLE\" usermodes=\"*\" chanmodes=\"*\" privs=\"users\/mass-message\">\n";
  177. print OPERSCONF "<class name=\"HostCloak\" commands=\"SETHOST SETIDENT SETNAME CHGHOST CHGIDENT TAXONOMY\" usermodes=\"*\" chanmodes=\"*\" privs=\"users\/auspex\">\n";
  178. print OPERSCONF "\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\n";
  179. print OPERSCONF "\#     OPER TYPES     \#\n";
  180. print OPERSCONF "\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\n";
  181. print OPERSCONF "<type name=\"NetAdmin\" classes=\"Everything\" vhost=\"NetAdmin.$NetAddress\" modes=\"+s +AaCcQqkKLlOodXxtf\" override=\"*\" level=\"2\">\n";
  182. print OPERSCONF "<type name=\"GlobalOp\" classes=\"OperChat BanControl HostCloak ServerLink\" vhost=\"GlobalOp.$NetAddress\" level=\"1\" override=\"*\">\n";
  183. print OPERSCONF "<type name=\"Helper\" classes=\"HostCloak\" vhost=\"helper.$NetAddress\">\n";
  184. print OPERSCONF "\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\n";
  185. print OPERSCONF "\#       OPERS        \#\n";
  186. print OPERSCONF "\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\n";
  187. print OPERSCONF "<oper\n";
  188. print OPERSCONF "      name=\"$MyNick\"\n";
  189. print OPERSCONF "      password=\"$MyPass\"\n";
  190. print OPERSCONF "      host=\"$MyHost *\@127.0.0.1\"\n";
  191. print OPERSCONF "      sslonly=\"yes\"\n";
  192. print OPERSCONF "      vhost=\"$MyNick.NetAdmin.$NetAddress\"\n";
  193. print OPERSCONF "      type=\"NetAdmin\">\n";
  194. close (OPERSCONF);
  195. print "Your inspircd.conf and opers.conf have been created.\n";
  196. print "To oper up, connect to your IRCd on port +6697, and use $MyNick as your opernick, and $MyPass as your oper pass.\n";
  197. print "To shutdown\/restart the IRCd, use $MyPass as a password.\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement