Compare commits
No commits in common. "d8584486b9cae6b9bef012de67f73c4340dd36a6" and "1ceffa56f827276e0bed00d13eb09c97729c8dc7" have entirely different histories.
d8584486b9
...
1ceffa56f8
@ -8,7 +8,7 @@
|
|||||||
#ifndef REHDD_H_
|
#ifndef REHDD_H_
|
||||||
#define REHDD_H_
|
#define REHDD_H_
|
||||||
|
|
||||||
#define REHDD_VERSION "V1.2.0"
|
#define REHDD_VERSION "V1.1.3"
|
||||||
|
|
||||||
// Drive handling Settings
|
// Drive handling Settings
|
||||||
#define WORSE_HOURS 19200 // mark drive if at this limit or beyond
|
#define WORSE_HOURS 19200 // mark drive if at this limit or beyond
|
||||||
@ -25,13 +25,13 @@
|
|||||||
#define SOFTWARE_VERSION REHDD_VERSION
|
#define SOFTWARE_VERSION REHDD_VERSION
|
||||||
#define HARDWARE_VERSION "generic"
|
#define HARDWARE_VERSION "generic"
|
||||||
|
|
||||||
// #define LOG_LEVEL_HIGH // log everything, like drive scan thread
|
// #define LOG_LEVEL_HIGH //log everything, like drive scan thread
|
||||||
#ifndef LOG_LEVEL_HIGH
|
#ifndef LOG_LEVEL_HIGH
|
||||||
#define LOG_LEVEL_LOW // log only user actions and tasks
|
#define LOG_LEVEL_LOW // log only user actions and tasks
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Logic
|
// Logic
|
||||||
// #define DRYRUN // don't touch the drives
|
//#define DRYRUN // don't touch the drives
|
||||||
#define FROZEN_ALERT // show alert if drive is frozen
|
#define FROZEN_ALERT // show alert if drive is frozen
|
||||||
#define ZERO_CHECK // check drive after shred if all bytes are zero, show alert if this fails
|
#define ZERO_CHECK // check drive after shred if all bytes are zero, show alert if this fails
|
||||||
|
|
||||||
@ -86,7 +86,6 @@ private:
|
|||||||
static void searchDrives(list<Drive> *plistDrives);
|
static void searchDrives(list<Drive> *plistDrives);
|
||||||
static void printDrives(list<Drive> *plistDrives);
|
static void printDrives(list<Drive> *plistDrives);
|
||||||
static void startShredAllDrives(list<Drive> *plistDrives);
|
static void startShredAllDrives(list<Drive> *plistDrives);
|
||||||
static void stopShredAllDrives(list<Drive> *plistDrives);
|
|
||||||
static void updateShredMetrics(list<Drive> *plistDrives);
|
static void updateShredMetrics(list<Drive> *plistDrives);
|
||||||
static void filterIgnoredDrives(list<Drive> *plistDrives);
|
static void filterIgnoredDrives(list<Drive> *plistDrives);
|
||||||
static void filterInvalidDrives(list<Drive> *plistDrives);
|
static void filterInvalidDrives(list<Drive> *plistDrives);
|
||||||
|
@ -31,7 +31,6 @@ public:
|
|||||||
Delete,
|
Delete,
|
||||||
Enter,
|
Enter,
|
||||||
ESC,
|
ESC,
|
||||||
Terminate,
|
|
||||||
Undefined
|
Undefined
|
||||||
};
|
};
|
||||||
struct MenuState
|
struct MenuState
|
||||||
|
@ -197,12 +197,6 @@ void reHDD::ThreadUserInput()
|
|||||||
handleESC();
|
handleESC();
|
||||||
ui->updateTUI(&listDrives, u8SelectedEntry);
|
ui->updateTUI(&listDrives, u8SelectedEntry);
|
||||||
break;
|
break;
|
||||||
case TUI::UserInput::Terminate:
|
|
||||||
cout << "Terminate" << endl;
|
|
||||||
stopShredAllDrives(&listDrives);
|
|
||||||
sleep(5); // sleep 5 sec
|
|
||||||
std::exit(1); // Terminates main, doesn't wait for threads
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -470,34 +464,6 @@ void reHDD::startShredAllDrives(list<Drive> *plistDrives)
|
|||||||
mxDrives.unlock();
|
mxDrives.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief stop shred for all drives
|
|
||||||
* \param pointer of list <Drive>* plistDrives
|
|
||||||
* \return void
|
|
||||||
*/
|
|
||||||
void reHDD::stopShredAllDrives(list<Drive> *plistDrives)
|
|
||||||
{
|
|
||||||
list<Drive>::iterator it;
|
|
||||||
mxDrives.lock();
|
|
||||||
for (it = plistDrives->begin(); it != plistDrives->end(); ++it)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (it->state == Drive::SHRED_ACTIVE || it->state == Drive::DELETE_ACTIVE)
|
|
||||||
{
|
|
||||||
it->state = Drive::NONE;
|
|
||||||
Logger::logThis()->info("Abort-Shred-Signal for: " + it->getModelName() + "-" + it->getSerial());
|
|
||||||
// task for drive is running --> remove selection
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef LOG_LEVEL_HIGH
|
|
||||||
ostringstream address;
|
|
||||||
address << (void const *)&(*it);
|
|
||||||
Logger::logThis()->info("Started shred (all) for: " + it->getModelName() + "-" + it->getSerial() + " @" + address.str());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
mxDrives.unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief print drives with all information
|
* \brief print drives with all information
|
||||||
* \param pointer of list <Drive>* plistDrives
|
* \param pointer of list <Drive>* plistDrives
|
||||||
|
@ -187,7 +187,7 @@ int Shred::shredDrive(Drive *drive, int *ipSignalFd)
|
|||||||
Logger::logThis()->info("Check-Task started - Drive: " + drive->getModelName() + "-" + drive->getSerial() + " @" + address.str());
|
Logger::logThis()->info("Check-Task started - Drive: " + drive->getModelName() + "-" + drive->getSerial() + " @" + address.str());
|
||||||
drive->u32DriveChecksumAfterShredding = uiCalcChecksum(driveFileDiscr, drive, ipSignalFd);
|
drive->u32DriveChecksumAfterShredding = uiCalcChecksum(driveFileDiscr, drive, ipSignalFd);
|
||||||
#ifdef LOG_LEVEL_HIGH
|
#ifdef LOG_LEVEL_HIGH
|
||||||
if (drive->u32DriveChecksumAfterShredding != 0)
|
if (drive->u32DriveChecksumAferShredding != 0)
|
||||||
{
|
{
|
||||||
Logger::logThis()->info("Shred-Task: Checksum not zero: " + to_string(drive->u32DriveChecksumAfterShredding) + " - Drive: " + drive->getSerial());
|
Logger::logThis()->info("Shred-Task: Checksum not zero: " + to_string(drive->u32DriveChecksumAfterShredding) + " - Drive: " + drive->getSerial());
|
||||||
}
|
}
|
||||||
|
@ -237,9 +237,6 @@ enum TUI::UserInput TUI::readUserInput()
|
|||||||
case 'S':
|
case 'S':
|
||||||
return TUI::UserInput::ShredAll;
|
return TUI::UserInput::ShredAll;
|
||||||
break;
|
break;
|
||||||
case 'T':
|
|
||||||
return TUI::UserInput::Terminate;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return TUI::UserInput::Undefined;
|
return TUI::UserInput::Undefined;
|
||||||
break;
|
break;
|
||||||
@ -485,12 +482,8 @@ WINDOW *TUI::createMenuView(int iXSize, int iYSize, int iXStart, int iYStart, st
|
|||||||
{
|
{
|
||||||
string sLineTmp = "Press d for Delete";
|
string sLineTmp = "Press d for Delete";
|
||||||
mvwaddstr(newWindow, u16Line++, (iXSize / 2) - (sLineTmp.size() / 2), sLineTmp.c_str());
|
mvwaddstr(newWindow, u16Line++, (iXSize / 2) - (sLineTmp.size() / 2), sLineTmp.c_str());
|
||||||
u16Line++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string sLineTmp = "Press T for terminating reHDD";
|
|
||||||
mvwaddstr(newWindow, u16Line++, (iXSize / 2) - (sLineTmp.size() / 2), sLineTmp.c_str());
|
|
||||||
|
|
||||||
return newWindow;
|
return newWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user