mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Download app list to a temp file
This commit is contained in:
parent
081c0c8b7f
commit
eee43f5e11
1 changed files with 5 additions and 1 deletions
|
@ -80,9 +80,13 @@ def app_fetchlist(url=None, name=None):
|
||||||
else:
|
else:
|
||||||
if name is None: 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:
|
list_file = repo_path +'/'+ name +'.json'
|
||||||
|
if os.system('wget "'+ url +'" -O "'+ list_file +'.tmp"') != 0:
|
||||||
raise YunoHostError(1, _("List server connection failed"))
|
raise YunoHostError(1, _("List server connection failed"))
|
||||||
|
|
||||||
|
# Rename fetched temp list
|
||||||
|
os.rename(list_file +'.tmp', list_file)
|
||||||
|
|
||||||
os.system("touch /etc/cron.d/yunohost-applist-"+ name)
|
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)
|
os.system("echo '00 00 * * * root yunohost app fetchlist -u "+ url +" -n "+ name +" --no-ldap >> /dev/null' >/etc/cron.d/yunohost-applist-"+ name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue