mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Enter password at prompt automaticaly
This commit is contained in:
parent
c2e57d5e0a
commit
185e4bbd0e
1 changed files with 5 additions and 6 deletions
|
@ -33,7 +33,7 @@ from yunohost import YunoHostError, YunoHostLDAP, validate, colorize, get_requir
|
|||
from yunohost_domain import domain_add
|
||||
from yunohost_dyndns import dyndns_subscribe
|
||||
|
||||
def tools_ldapinit():
|
||||
def tools_ldapinit(password=None):
|
||||
"""
|
||||
YunoHost LDAP initialization
|
||||
|
||||
|
@ -79,9 +79,8 @@ def tools_ldapinit():
|
|||
os.system('smbpasswd -w yunohost')
|
||||
sid = subprocess.check_output(['net', 'getlocalsid']).strip().split(':')[1][1:]
|
||||
os.system('echo \'SID="'+ sid +'"\' >> /etc/smbldap-tools/smbldap.conf')
|
||||
#os.system('smbldap-populate -e /tmp/samba-ldap.ldif')
|
||||
os.system('smbldap-populate')
|
||||
# TODO: change root domain password
|
||||
if password is not None:
|
||||
os.system('echo "'+ password +'\n'+ password +'" | smbldap-populate')
|
||||
|
||||
win_msg(_("LDAP has been successfully initialized"))
|
||||
|
||||
|
@ -253,7 +252,7 @@ def tools_postinstall(domain, password, dyndns=False):
|
|||
raise YunoHostError(17, _("There were a problem during CA creation"))
|
||||
|
||||
# Initialize YunoHost LDAP base
|
||||
tools_ldapinit()
|
||||
tools_ldapinit(password)
|
||||
|
||||
# New domain config
|
||||
tools_maindomain(old_domain='yunohost.org', new_domain=domain)
|
||||
|
|
Loading…
Add table
Reference in a new issue