+ err_flg = uci_set(ctx, &ptr);
+ if (err_flg == UCI_OK) {
+ if (save_immediately == true) {
+ err_flg = uci_save(ctx, pkg);
+ if (err_flg != UCI_OK) {
+ log_error("Failed to set value to configuration file: %s\n. Could not save the file\n", fname);
+ }
+ }
+ if (err_flg == UCI_OK) {
+ ret_val = true;
+ log_debug("Set value to section %s in configuration file: %s\n", section_name, fname);
+ }
+ }
+ else {
+ log_error("Failed to set value to configuration file: %s\n. Could not set new value\n", fname);
+ }