Commit 2087f7a7 authored by Daniel Bissani Furlin's avatar Daniel Bissani Furlin
Browse files

Change static hostname

parent f35c3d18
Pipeline #13025 passed with stages
in 27 minutes and 8 seconds
......@@ -6,4 +6,4 @@ incoming = /home/repository/www/le6/incoming
allow_unsigned_uploads = 1
ssh_config_options = User=repository
StrictHostKeyChecking=no
post_upload_command = ssh -l repository -i ~/.ssh/id_rsa repo.c3sl.ufpr.br "reprepro -Vb /home/repository/www/le6 includedeb testing *deb"
post_upload_command = ssh -l repository -i ~/.ssh/id_rsa repo.c3sl.ufpr.br "reprepro -Vb /home/repository/www/le6 includedeb testing *.deb"
ubiquity (2.21.63.8) testing; urgency=medium
* Change static hostname on particular installation.
-- Daniel Bissani Furlin <dbf15@c3sl.ufpr.br> Tue, 17 Oct 2017 10:50:12 -0200
ubiquity (2.21.63.7) testing; urgency=medium
 
* Force timezone to America/Sao_Paulo when user chooses a pt_BR installation.
......
......@@ -456,14 +456,20 @@ class Install(install_misc.InstallBase):
shutil.copy2(path, targetpath)
else:
if not os.path.exists('/etc/network/interfaces'):
# Make sure there's at least something here so that ifupdown
# Make sure there's at least something here so that ifupdown
# doesn't get upset at boot.
with open('/etc/network/interfaces', 'w') as interfaces:
print(INTERFACES_TEXT, file=interfaces)
try:
hostname = self.db.get('netcfg/get_hostname')
hostname = 'LE-' + self.id_gen(4)
try:
version = open("/etc/default/version", "r")
version = version.readline()
if "Escola" in version:
hostname = 'LE-' + self.id_gen(4)
except:
pass
except debconf.DebconfError:
hostname = ''
try:
......@@ -471,8 +477,13 @@ class Install(install_misc.InstallBase):
except debconf.DebconfError:
domain = ''
if hostname == '':
hostname = 'LE-' + self.id_gen(4)
try:
version = open("/etc/default/version", "r")
version = version.readline()
if "Escola" in version:
hostname = 'LE-' + self.id_gen(4)
except:
pass
with open(self.target_file('etc/hosts'), 'w') as hosts:
print("127.0.0.1\tlocalhost", file=hosts)
if domain:
......
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