mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2026-01-28 01:27:16 +01:00
Add support for full uci import
If the downloaded file matches the following pattern "*.uci.conf" then the file will be imported without setting the specific package in uci. e.g. the package needs to be part of the file itself.
This commit is contained in:
parent
28fdf0a23b
commit
35228b84fb
1 changed files with 6 additions and 1 deletions
|
|
@ -524,8 +524,13 @@ int apply_downloaded_file(struct download *pdownload, char *download_file_name,
|
|||
int err = CWMP_OK;
|
||||
if (download_file_name != NULL) {
|
||||
char file_path[512];
|
||||
|
||||
snprintf(file_path, sizeof(file_path), "/tmp/%s", download_file_name);
|
||||
err = cwmp_uci_import(download_file_name, file_path, UCI_STANDARD_CONFIG);
|
||||
if (strstr(download_file_name, ".uci.conf") != NULL) {
|
||||
err = cwmp_uci_import(NULL, file_path, UCI_STANDARD_CONFIG);
|
||||
} else {
|
||||
err = cwmp_uci_import(download_file_name, file_path, UCI_STANDARD_CONFIG);
|
||||
}
|
||||
remove(file_path);
|
||||
} else {
|
||||
err = cwmp_uci_import("vendor_conf_file", VENDOR_CONFIG_FILE, UCI_STANDARD_CONFIG);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue