Add fetchlist cron + correct other crons

This commit is contained in:
Kload 2013-10-31 11:11:44 +01:00
parent d5b8c568c5
commit aa2f87d70a
3 changed files with 8 additions and 4 deletions

View file

@ -73,15 +73,18 @@ def app_fetchlist(url=None, name=None):
try: os.listdir(repo_path)
except OSError: os.makedirs(repo_path)
if not url:
if url is None:
url = 'http://app.yunohost.org/list.json'
name = 'yunohost'
else:
if not name: raise YunoHostError(22, _("You must indicate a name for your custom list"))
if name is None: raise YunoHostError(22, _("You must indicate a name for your custom list"))
if os.system('wget "'+ url +'" -O "'+ repo_path +'/'+ name +'.json"') != 0:
raise YunoHostError(1, _("List server connection failed"))
os.system("touch /etc/cron.d/yunohost-applist-"+ name)
os.system("echo '00 00 * * * root yunohost app fetchlist -u "+ url +" -n "+ name +" --no-ldap >> /dev/null' >/etc/cron.d/yunohost-applist-"+ name)
win_msg(_("List successfully fetched"))
@ -95,6 +98,7 @@ def app_removelist(name):
"""
try:
os.remove(repo_path +'/'+ name + '.json')
os.remove("/etc/cron.d/yunohost-applist-"+ name)
except OSError:
raise YunoHostError(22, _("Unknown list"))

View file

@ -146,7 +146,7 @@ def dyndns_installcron():
"""
os.system("touch /etc/cron.d/yunohost-dyndns")
os.system("echo '*/30 * * * * root yunohost dyndns update >> /dev/null' >/etc/cron.d/yunohost-dyndns")
os.system("echo '*/30 * * * * root yunohost dyndns update --no-ldap >> /dev/null' >/etc/cron.d/yunohost-dyndns")
win_msg(_("DynDNS cron installed"))

View file

@ -310,7 +310,7 @@ def firewall_installupnp():
firewall['UPNP']['cron'] = True
os.system("touch /etc/cron.d/yunohost-firewall")
os.system("echo '*/50 * * * * root yunohost firewall reload -u>>/dev/null'>/etc/cron.d/yunohost-firewall")
os.system("echo '*/50 * * * * root yunohost firewall reload -u --no-ldap >>/dev/null'>/etc/cron.d/yunohost-firewall")
win_msg(_("UPNP cron installed"))
os.system("mv /etc/yunohost/firewall.yml /etc/yunohost/firewall.yml.old")