Configure backup at post-installation

This commit is contained in:
Kload 2013-08-05 09:31:13 +02:00
parent 49eae5fbe8
commit d906d2648a
2 changed files with 15 additions and 1 deletions

View file

@ -38,4 +38,14 @@ def backup_init(helper=False):
helper -- Init as a helper node rather than a "helped" one helper -- Init as a helper node rather than a "helped" one
""" """
pass tahoe_cfg_dir = '/usr/share/yunohost/yunohost-config/backup'
if helper:
configure_cmd = '/configure_tahoe.sh helper'
else:
configure_cmd = '/configure_tahoe.sh'
os.system('tahoe create-client /home/yunohost.backup/tahoe')
os.system('/bin/bash '+ tahoe_cfg_dir + configure_cmd)
os.system('cp '+ tahoe_cfg_dir +'/tahoe.cfg /home/yunohost.backup/tahoe/')
os.system('update-rc.d tahoe-lafs defaults')
os.system('service tahoe-lafs restart')

View file

@ -34,6 +34,7 @@ import json
from yunohost import YunoHostError, YunoHostLDAP, validate, colorize, get_required_args, win_msg from yunohost import YunoHostError, YunoHostLDAP, validate, colorize, get_required_args, win_msg
from yunohost_domain import domain_add from yunohost_domain import domain_add
from yunohost_dyndns import dyndns_subscribe from yunohost_dyndns import dyndns_subscribe
from yunohost_backup import backup_init
def tools_ldapinit(password=None): def tools_ldapinit(password=None):
""" """
@ -287,6 +288,9 @@ def tools_postinstall(domain, password, dyndns=False):
# Change LDAP admin password # Change LDAP admin password
tools_adminpw(old_password='yunohost', new_password=password) tools_adminpw(old_password='yunohost', new_password=password)
# Initialize backup system
backup_init()
os.system('touch /etc/yunohost/installed') os.system('touch /etc/yunohost/installed')
os.system('service samba restart') os.system('service samba restart')