[displaymanager] update OEM autologin

This commit is contained in:
Philip Müller 2020-04-22 19:01:58 +02:00
parent 261ab35b9c
commit 7778518afd

View File

@ -287,7 +287,9 @@ class DMmdm(DisplayManager):
with open(mdm_conf_path, 'w') as mdm_conf: with open(mdm_conf_path, 'w') as mdm_conf:
for line in text: for line in text:
if '[daemon]' in line: if 'AutomaticLogin=' in line:
line = "AutomaticLogin={!s}\n".format(username)
else '[daemon]' in line:
if do_autologin: if do_autologin:
line = ( line = (
"[daemon]\n" "[daemon]\n"
@ -299,8 +301,6 @@ class DMmdm(DisplayManager):
"[daemon]\n" "[daemon]\n"
"AutomaticLoginEnable=False\n" "AutomaticLoginEnable=False\n"
) )
if 'AutomaticLogin=' in line:
line = "AutomaticLogin={!s}\n".format(username)
mdm_conf.write(line) mdm_conf.write(line)
else: else:
@ -398,7 +398,9 @@ class DMgdm(DisplayManager):
with open(gdm_conf_path, 'w') as gdm_conf: with open(gdm_conf_path, 'w') as gdm_conf:
for line in text: for line in text:
if '[daemon]' in line: if 'AutomaticLogin=' in line:
line = "AutomaticLogin={!s}\n".format(username)
else '[daemon]' in line:
if do_autologin: if do_autologin:
line = ( line = (
"[daemon]\n" "[daemon]\n"
@ -407,8 +409,6 @@ class DMgdm(DisplayManager):
) )
else: else:
line = "[daemon]\nAutomaticLoginEnable=False\n" line = "[daemon]\nAutomaticLoginEnable=False\n"
if 'AutomaticLogin=' in line:
line = "AutomaticLogin={!s}\n".format(username)
gdm_conf.write(line) gdm_conf.write(line)
else: else: