Advertisement
Guest User

UnrealIRCd 3.2 Configuration File Generator

a guest
Jun 26th, 2010
1,053
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 10.62 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2. # UnrealIRCd 3.2.x Configuration File Generator
  3. # Run from the root directory of UnrealIRCd (usuall ~/Unreal3.2)
  4. # E-Mail bugs/suggestions to miniCruzer@live.com
  5. use Term::ANSIColor;
  6. $ConfFile = "unrealircd.conf";
  7. unlink $ConfFile;
  8. system("clear");
  9. print color 'bold blue';
  10. print " _    _                      _ _____ _____   _____    _ \n";
  11. print "| |  | |                    | |_   _|  __ \\ / ____|  | |\n";
  12. print "| |  | |_ __  _ __ ___  __ _| | | | | |__) | |     __| |\n";
  13. print "| |  | | '_ \\| '__/ _ \\\/ _` | | | | |  _  \/| |    / _` |\n";
  14. print "| |__| | | | | | |  __/ (_| | |_| |_| | \\ \\| |___| (_| |\n";
  15. print " \\____/|_| |_|_|  \\___|\\__,_|_|_____|_|  \\_\\\\_____\\__,_|\n";
  16. print color 'reset';
  17. print color 'bold';
  18. print "This is an auto-conf generator script for Unreal 3.2.\n";
  19. print "Run this from the root of UnrealIRCd (usually ~\/Unreal3.2)\n";
  20. print "Warning: If you have a pre-exisiting unrealircd.conf in this\n";
  21. print "directory, it has been deleted.\n";
  22. print "**********************************************************\n";
  23. print "IP for IRCd to bind on. [Required]\n";
  24. $BindIP = <STDIN>;
  25. chomp($BindIP);
  26. print "Network name. [Required]\n";
  27. $NetName = <STDIN>;
  28. chomp($BindIP);
  29. print "Full network address. [Required]\n";
  30. $NetAddress = <STDIN>;
  31. chomp($NetAddress);
  32. print "Server name. [Required]\n";
  33. $ServName = <STDIN>;
  34. chomp($ServName);
  35. print "Your resolved hostname. (Example: *\@*.dhcp.insightbb.com) [Recommended]\n";
  36. $MyHost = <STDIN>;
  37. chomp($MyHost);
  38. print "Email address. [Required]\n";
  39. $MyEmail = <STDIN>;
  40. chomp($MyEmail);
  41. print "Your nickname. [Required]\n";
  42. $MyNick = <STDIN>;
  43. chomp($MyNick);
  44. print "Main network channel [Recommended]\n";
  45. $MainChan = <STDIN>;
  46. chomp($MainChan);
  47. print "Network help channel. [Recommended]\n";
  48. $HelpChan = <STDIN>;
  49. chomp($HelpChan);
  50. print "Address of services your server is using. (Example: services.$NetAddress) [Required]\n";
  51. $Services = <STDIN>;
  52. chomp($Services);
  53. print "Default network server. [Optional]\n";
  54. $DefServ = <STDIN>;
  55. chomp($DefServ);
  56. print "Address of stats your server is using. (Example. stats.$NetAddress) [Optional]\n";
  57. $Stats = <STDIN>;
  58. chomp($Stats);
  59. print "Password to be used to oper-up and shutdown or restart the IRCd. [Required]\n";
  60. $MyPass = <STDIN>;
  61. chomp($MyPass);
  62. open (UNREALCONF, '>>unrealircd.conf');
  63. print UNREALCONF "cgiirc {\n";
  64. print UNREALCONF "       type webirc;\n";
  65. print UNREALCONF "       hostname 64.62.228.82;\n";
  66. print UNREALCONF "       password password;\n";
  67. print UNREALCONF "};\n";
  68. print UNREALCONF "\n";
  69. print UNREALCONF "cgiirc {\n";
  70. print UNREALCONF "       type webirc;\n";
  71. print UNREALCONF "       hostname 207.192.75.252;\n";
  72. print UNREALCONF "       password password;\n";
  73. print UNREALCONF "};\n";
  74. print UNREALCONF "loadmodule \"src/modules/commands.so\";\n";
  75. print UNREALCONF "loadmodule \"src/modules/cloak.so\";\n";
  76. print UNREALCONF "include \"help.conf\";\n";
  77. print UNREALCONF "include \"badwords.channel.conf\";\n";
  78. print UNREALCONF "include \"badwords.message.conf\";\n";
  79. print UNREALCONF "include \"badwords.quit.conf\";\n";
  80. print UNREALCONF "include \"spamfilter.conf\";\n";
  81. print UNREALCONF "include \"aliases/anope.conf\";\n";
  82. print UNREALCONF "me\n";
  83. print UNREALCONF "{\n";
  84. print UNREALCONF "  name \"$ServName\";\n";
  85. print UNREALCONF "  info \"$NetName Client Server\";\n";
  86. print UNREALCONF "  numeric 32;\n";
  87. print UNREALCONF "};\n";
  88. print UNREALCONF "\n";
  89. print UNREALCONF "admin {\n";
  90. print UNREALCONF \"$NetName Server\";\n";
  91. print UNREALCONF \"Server Channel: $MainChan\";\n";
  92. print UNREALCONF \"Help Channel: $HelpChan\";\n";
  93. print UNREALCONF "        \"Server Administrator(s): $MyNick\";\n";
  94. print UNREALCONF "};\n";
  95. print UNREALCONF "class           clients\n";
  96. print UNREALCONF "{\n";
  97. print UNREALCONF "  pingfreq 90;\n";
  98. print UNREALCONF "  maxclients 500;\n";
  99. print UNREALCONF "  sendq 100000;\n";
  100. print UNREALCONF "  recvq 8000;\n";
  101. print UNREALCONF "};\n";
  102. print UNREALCONF "class           servers\n";
  103. print UNREALCONF "{\n";
  104. print UNREALCONF "  pingfreq 90;\n";
  105. print UNREALCONF "  maxclients 10;  \n";
  106. print UNREALCONF "  sendq 1000000;\n";
  107. print UNREALCONF "  connfreq 100;\n";
  108. print UNREALCONF "};\n";
  109. print UNREALCONF "allow {\n";
  110. print UNREALCONF "  ip             *@*;\n";
  111. print UNREALCONF "  hostname       *@*;\n";
  112. print UNREALCONF "  class           clients;\n";
  113. print UNREALCONF "  maxperip 5;\n";
  114. print UNREALCONF "};\n";
  115. print UNREALCONF "listen          $BindIP:6697 { options { ssl; clientsonly; }; };\n";
  116. print UNREALCONF "listen          $BindIP:55401 { options { ssl; serversonly; }; };\n";
  117. print UNREALCONF "listen          $BindIP:6660-6669 { options { clientsonly; }; };\n";
  118. print UNREALCONF "listen          $BindIP:7002 { options { serversonly; }; };\n";
  119. print UNREALCONF "ulines {\n";
  120. print UNREALCONF "  $Services;\n";
  121. print UNREALCONF "};\n";
  122. print UNREALCONF "drpass { restart \"$MyPass\"; die \"$MyPass\"; };\n";
  123. print UNREALCONF "log \"ircd.log\" {\n";
  124. print UNREALCONF "  maxsize 2097152;\n";
  125. print UNREALCONF "  flags {\n";
  126. print UNREALCONF "      oper;\n";
  127. print UNREALCONF "      kline;\n";
  128. print UNREALCONF "      connects;\n";
  129. print UNREALCONF "      server-connects;\n";
  130. print UNREALCONF "      kills;\n";
  131. print UNREALCONF "      errors;\n";
  132. print UNREALCONF "      sadmin-commands;\n";
  133. print UNREALCONF "      chg-commands;\n";
  134. print UNREALCONF "      oper-override;\n";
  135. print UNREALCONF "      spamfilter;\n";
  136. print UNREALCONF "  };\n";
  137. print UNREALCONF "};\n";
  138. print UNREALCONF "tld {\n";
  139. print UNREALCONF "  mask *@*;\n";
  140. print UNREALCONF "  motd \"ircd.motd\";\n";
  141. print UNREALCONF "  rules \"ircd.rules\";\n";
  142. print UNREALCONF "};\n";
  143. print UNREALCONF "except ban {\n";
  144. print UNREALCONF "  mask           *\@*.dhcp.insightbb.com;\n";
  145. print UNREALCONF "};\n";
  146. print UNREALCONF "set {\n";
  147. print UNREALCONF "  network-name        \"$NetName\";\n";
  148. print UNREALCONF "  default-server      \"$DefServ\";\n";
  149. print UNREALCONF "  services-server     \"$Services\";\n";
  150. print UNREALCONF "  stats-server        \"$Stats\";\n";
  151. print UNREALCONF "  help-channel        \"$HelpChan\";\n";
  152. print UNREALCONF "  hiddenhost-prefix   \"$NetName\";\n";
  153. print UNREALCONF "  cloak-keys {\n";
  154. print UNREALCONF "      \"scgh437ygvb436u4on3pioj6pnt5yh3p4oj45pOJ\";\n";
  155. print UNREALCONF "      \"OBNopi4ni3opjPOJNopj345j2ponpoPOJplj34pn\";\n";
  156. print UNREALCONF "      \"oiJIOPJNPOj234pojpoj324opknpnPOJpojpdxfa\";\n";
  157. print UNREALCONF "  };\n";
  158. print UNREALCONF "  hosts {\n";
  159. print UNREALCONF "      local       \"local.$NetAddress\";\n";
  160. print UNREALCONF "      global      \"global.$NetAddress\";\n";
  161. print UNREALCONF "      coadmin     \"coadmin.$NetAddress\";\n";
  162. print UNREALCONF "      admin       \"admin.$NetAddress\";\n";
  163. print UNREALCONF "      servicesadmin   \"techadmin.$NetAddress\";\n";
  164. print UNREALCONF "      netadmin    \"netadmin.$NetAddress\";\n";
  165. print UNREALCONF "      host-on-oper-up \"yes\";\n";
  166. print UNREALCONF "  };\n";
  167. print UNREALCONF "  kline-address \"$MyEmail\";\n";
  168. print UNREALCONF "  gline-address \"$MyEmail\";\n";
  169. print UNREALCONF "  modes-on-connect \"+ixw\";\n";
  170. print UNREALCONF "  modes-on-oper    \"+Wxwgspq\";\n";
  171. print UNREALCONF "  snomask-on-oper \"+cFfkejvGnNqsSo\";\n";
  172. print UNREALCONF "  restrict-usermodes \"iwx\";\n";
  173. print UNREALCONF "  oper-auto-join \"$MainChan,$HelpChan,\#Services,\#Opers\";\n";
  174. print UNREALCONF "  options {\n";
  175. print UNREALCONF "      flat-map;\n";
  176. print UNREALCONF "      hide-ulines;\n";
  177. print UNREALCONF "      show-opermotd;\n";
  178. print UNREALCONF "      allow-part-if-shunned;\n";
  179. print UNREALCONF "      fail-oper-warn;\n";
  180. print UNREALCONF "      show-connect-info;\n";
  181. print UNREALCONF "  };\n";
  182. print UNREALCONF "  maxchannelsperuser 10;\n";
  183. print UNREALCONF "  anti-spam-quit-message-time 10s;\n";
  184. print UNREALCONF "  oper-only-stats \"*\";\n";
  185. print UNREALCONF "  throttle {\n";
  186. print UNREALCONF "      connections 3;\n";
  187. print UNREALCONF "      period 60s;\n";
  188. print UNREALCONF "  };\n";
  189. print UNREALCONF "  anti-flood {\n";
  190. print UNREALCONF "      nick-flood 3:60;\n";
  191. print UNREALCONF "  };\n";
  192. print UNREALCONF "  spamfilter {\n";
  193. print UNREALCONF "      ban-time 1d;\n";
  194. print UNREALCONF "      ban-reason \"Spam\/Advertising\";\n";
  195. print UNREALCONF "      virus-help-channel \"$HelpChan\";\n";
  196. print UNREALCONF "      except \"#help\";\n";
  197. print UNREALCONF "  };\n";
  198. print UNREALCONF "};\n";
  199. print UNREALCONF "ban realname {\n";
  200. print UNREALCONF "  mask \"wIRC-client\";\n";
  201. print UNREALCONF "  reason \"Do not attempt to use wIRC here.\";\n";
  202. print UNREALCONF "};\n";
  203. print UNREALCONF "except tkl {\n";
  204. print UNREALCONF "  mask $MyHost;\n";
  205. print UNREALCONF "  type { gline; gzline; qline; gqline; shun; };\n";
  206. print UNREALCONF "};\n";
  207. print UNREALCONF "except tkl { mask *\@72.64.145.20; type { gline; gzline; qline; gqline; shun; }; };\n";
  208. print UNREALCONF "except ban { mask *\@72.64.145.20; };\n";
  209. print UNREALCONF "except tkl { mask *\@*.server4you.de; type { gline; gzline; qline; gqline; shun; }; };\n";
  210. print UNREALCONF "except ban { mask *\@*.server4you.de; };\n";
  211. print UNREALCONF "oper $MyNick {\n";
  212. print UNREALCONF "        class           clients;\n";
  213. print UNREALCONF "        from {\n";
  214. print UNREALCONF "                userhost $MyHost;\n";
  215. print UNREALCONF "        };\n";
  216. print UNREALCONF "        password \"$MyPass\";\n";
  217. print UNREALCONF "        flags\n";
  218. print UNREALCONF "        {\n";
  219. print UNREALCONF "                netadmin;\n";
  220. print UNREALCONF "                can_rehash;\n";
  221. print UNREALCONF "                can_die;\n";
  222. print UNREALCONF "                can_restart;\n";
  223. print UNREALCONF "                helpop;\n";
  224. print UNREALCONF "                can_wallops;\n";
  225. print UNREALCONF "                can_globops;\n";
  226. print UNREALCONF "                can_localroute;\n";
  227. print UNREALCONF "                can_globalroute;\n";
  228. print UNREALCONF "                can_localkill;\n";
  229. print UNREALCONF "                can_globalkill;\n";
  230. print UNREALCONF "                can_kline;\n";
  231. print UNREALCONF "                can_gkline;\n";
  232. print UNREALCONF "                can_unkline;\n";
  233. print UNREALCONF "                can_localnotice;\n";
  234. print UNREALCONF "                can_globalnotice;\n";
  235. print UNREALCONF "                can_zline;\n";
  236. print UNREALCONF "                can_gzline;\n";
  237. print UNREALCONF "                get_umodew;\n";
  238. print UNREALCONF "                get_host;\n";
  239. print UNREALCONF "                can_override;\n";
  240. print UNREALCONF "                can_setq;\n";
  241. print UNREALCONF "                can_addline;\n";
  242. print UNREALCONF "                can_dccdeny;\n";
  243. print UNREALCONF "         };\n";
  244. print UNREALCONF "        snomask cFfkejvGnNqsSoJ;\n";
  245. print UNREALCONF "        modes WqHp;\n";
  246. print UNREALCONF "        swhois \"$NetName NetAdmin\"\n";
  247. print UNREALCONF "};\n";
  248. close (UNREALCONF);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement