mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Add fetchlist cron + correct other crons
This commit is contained in:
parent
d5b8c568c5
commit
aa2f87d70a
3 changed files with 8 additions and 4 deletions
|
@ -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"))
|
||||
|
||||
|
|
|
@ -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"))
|
||||
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Reference in a new issue