@@ -319,6 +319,9 @@ void NutsHelper::handleRescueOperation() {
319319 Logger::instance ().info (" === Starting Rescue Operation ===" );
320320 emitProgress (OperationStatus::CheckingConnectivity, 5 , " Checking environment" );
321321
322+ // Marker file path used throughout this function
323+ const QString rescueMarkerPath = " /var/run/nuts-cpp-rescue-completed" ;
324+
322325 // Check if running from Live session
323326 Logger::instance ().info (" Checking for Live session (looking for /usr/bin/calamares)" );
324327 if (!QFile::exists (" /usr/bin/calamares" )) {
@@ -330,7 +333,6 @@ void NutsHelper::handleRescueOperation() {
330333
331334 // Check if a rescue operation was already completed in this live session.
332335 // This prevents re-running the rescue when the user hasn't rebooted yet.
333- const QString rescueMarkerPath = " /var/run/nuts-cpp-rescue-completed" ;
334336 if (QFile::exists (rescueMarkerPath)) {
335337 Logger::instance ().warning (" A rescue operation was already completed in this session" );
336338 emitOperationFailed (" Rescue operation already completed. Please reboot the system to verify the restoration." );
@@ -524,7 +526,6 @@ void NutsHelper::handleRescueOperation() {
524526
525527 // Create a marker file to track that the rescue operation completed successfully.
526528 // This prevents re-running the rescue operation in the same live session.
527- const QString rescueMarkerPath = " /var/run/nuts-cpp-rescue-completed" ;
528529 QFile rescueMarkerFile (rescueMarkerPath);
529530 if (rescueMarkerFile.open (QIODevice::WriteOnly | QIODevice::Text)) {
530531 QDateTime now = QDateTime::currentDateTime ();
0 commit comments