Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions uploadstblogs/src/strategies.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,13 +850,7 @@ static int reboot_upload(RuntimeContext* ctx, SessionState* session)
"[%s:%d] Non-DCM mode (dcm_flag=0), will always upload logs\n",
__FUNCTION__, __LINE__);
}
// DCM mode (DCM_FLAG=1): Check upload_on_reboot flag
else if (ctx->upload_on_reboot) {
should_upload = true;
RDK_LOG(RDK_LOG_INFO, LOG_UPLOADSTB,
"[%s:%d] DCM mode: Upload enabled from settings (upload_on_reboot=true)\n",
__FUNCTION__, __LINE__);
} else {
else {
// Check reboot reason file for scheduled reboot (grep -i "Scheduled Reboot\|MAINTENANCE_REBOOT")
bool is_scheduled_reboot = false;
FILE* reboot_file = fopen(reboot_info_path, "r");
Expand Down Expand Up @@ -887,12 +881,12 @@ static int reboot_upload(RuntimeContext* ctx, SessionState* session)

RDK_LOG(RDK_LOG_INFO, LOG_UPLOADSTB, "[%s:%d] uploadLog:%s and UploadLogsOnUnscheduledReboot.Disable RFC: %s\n", __FUNCTION__, __LINE__, ctx->upload_on_reboot ? "true" : "false", disable_unscheduled_upload ? "true" : "false");

// Upload if: reboot reason is empty (unscheduled) AND RFC doesn't disable it
// Script logic: [ -z "$reboot_reason" -a "$DISABLE_UPLOAD_LOGS_UNSHEDULED_REBOOT" == "false" ]
if (!is_scheduled_reboot && !disable_unscheduled_upload) {
// Upload if upload_on_reboot is enabled, OR if the reboot is unscheduled
// and the UploadLogsOnUnscheduledReboot.Disable RFC does not disable it.
// Script logic for the unscheduled reboot path:
// [ -z "$reboot_reason" -a "$DISABLE_UPLOAD_LOGS_UNSHEDULED_REBOOT" == "false" ]
if ( ctx->upload_on_reboot==1 || (!is_scheduled_reboot && !disable_unscheduled_upload)) {
should_upload = true;
RDK_LOG(RDK_LOG_INFO, LOG_UPLOADSTB,
"[%s:%d] Unscheduled reboot and RFC allows upload\n", __FUNCTION__, __LINE__);
}
}

Expand Down
2 changes: 1 addition & 1 deletion uploadstblogs/src/uploadstblogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ bool parse_args(int argc, char** argv, RuntimeContext* ctx)

if (argc >= 5 && argv[4]) {
// Parse UploadOnReboot
ctx->upload_on_reboot = (strcmp(argv[4], "true") == 0) ? 1 : 0;
ctx->upload_on_reboot = (strcmp(argv[4], "true") == 0 || strcmp(argv[4], "1") == 0) ? 1 : 0;
fprintf(stderr, "DEBUG: UploadOnReboot (argv[4]) = '%s' -> %d\n", argv[4], ctx->upload_on_reboot);
}

Expand Down
Loading