mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
Fix some issues with replacing hostname in xmpp config.
This commit is contained in:
parent
079d774476
commit
5bee775bc8
@ -82,7 +82,7 @@ def subcommand_change_hostname(arguments):
|
||||
with open(JWCHAT_CONFIG, 'w') as conffile:
|
||||
for line in lines:
|
||||
if re.match(r'\s*var\s+SITENAME', line):
|
||||
conffile.write('var SITENAME = "' + new_hostname + '";')
|
||||
conffile.write('var SITENAME = "' + new_hostname + '";\n')
|
||||
else:
|
||||
conffile.write(line)
|
||||
else:
|
||||
@ -97,7 +97,8 @@ def subcommand_change_hostname(arguments):
|
||||
for line in lines:
|
||||
if in_hosts_section:
|
||||
if re.match(r'\s*-\s+"', line):
|
||||
conffile.write(line.replace(old_hostname, new_hostname))
|
||||
conffile.write(line.replace('"' + old_hostname + '"',
|
||||
'"' + new_hostname + '"'))
|
||||
else:
|
||||
in_hosts_section = False
|
||||
conffile.write(line)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user