diff --git a/src/loader/loader.c b/src/loader/loader.c index 8d4b8e0..5ef8029 100644 --- a/src/loader/loader.c +++ b/src/loader/loader.c @@ -127,7 +127,6 @@ crontab* load_crond(cleardns_config *config) { assets* load_assets(cleardns_config *config) { assets *resource = assets_init(); - // TODO: use ASSETS_DIR string_list_update(&resource->update_file, config->assets.update_file); string_list_update(&resource->update_url, config->assets.update_url); return resource; diff --git a/src/utils/assets.c b/src/utils/assets.c index 048024c..fda0ba5 100644 --- a/src/utils/assets.c +++ b/src/utils/assets.c @@ -52,8 +52,10 @@ void assets_update() { // update all assets log_info("Start assets update"); for (char **file = update.update_file; *file != NULL; ++file) { char **url = file - update.update_file + update.update_url; - log_info("Update asset `%s` -> %s", *file, *url); - download_file(*file, *url); // download asset from url + char *asset_file = string_join(ASSETS_DIR, *file); + log_info("Update asset `%s` -> %s", asset_file, *url); + download_file(asset_file, *url); // download asset from url + free(asset_file); } log_info("Restart overture"); run_command("pgrep overture | xargs kill"); // restart overture