Commit ef7f10c3 authored by Romain Bignon's avatar Romain Bignon

add parameter --hostname to change server hostname

parent fcd883f1
...@@ -438,7 +438,7 @@ class Server(object): ...@@ -438,7 +438,7 @@ class Server(object):
self.motdfile = options.motd self.motdfile = options.motd
self.verbose = options.verbose self.verbose = options.verbose
self.debug = options.debug self.debug = options.debug
self.name = socket.getfqdn()[:63] # Server name limit from the RFC. self.name = options.hostname
self.channels = {} # irc_lower(Channel name) --> Channel instance. self.channels = {} # irc_lower(Channel name) --> Channel instance.
self.clients = {} # Socket --> Client instance. self.clients = {} # Socket --> Client instance.
...@@ -593,6 +593,9 @@ def main(argv): ...@@ -593,6 +593,9 @@ def main(argv):
"-s", "--ssl-pem-file", "-s", "--ssl-pem-file",
metavar="FILE", metavar="FILE",
help="enable SSL and use FILE as the .pem certificate+key") help="enable SSL and use FILE as the .pem certificate+key")
op.add_option(
"--hostname",
help="Hostname of server (default %s)" % socket.getfqdn()[:63])
op.add_option( op.add_option(
"--ports", "--ports",
metavar="X", metavar="X",
...@@ -605,6 +608,8 @@ def main(argv): ...@@ -605,6 +608,8 @@ def main(argv):
(options, _) = op.parse_args(argv[1:]) (options, _) = op.parse_args(argv[1:])
if options.debug: if options.debug:
options.verbose = True options.verbose = True
if options.hostname is None:
options.hostname = socket.getfqdn()[:63]
if options.ports is None: if options.ports is None:
if options.ssl_pem_file is None: if options.ssl_pem_file is None:
options.ports = "6667" options.ports = "6667"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment