|
|
@ -21,9 +21,7 @@ void Quotas_sys::set_map_gui(map_str_str &map_gui) {
|
|
|
|
|
|
|
|
|
|
|
|
void Quotas_sys::check_partition_mount() {
|
|
|
|
void Quotas_sys::check_partition_mount() {
|
|
|
|
string key = "";
|
|
|
|
string key = "";
|
|
|
|
// Todo:
|
|
|
|
string response = Utils::file_read("/proc/mounts");
|
|
|
|
// Заменить на чтение файла средствами с++
|
|
|
|
|
|
|
|
string response = obj_process_call.call_all_sections("cat /proc/mounts");
|
|
|
|
|
|
|
|
for (const auto& iter: (*map_device)) {
|
|
|
|
for (const auto& iter: (*map_device)) {
|
|
|
|
key = iter.first;
|
|
|
|
key = iter.first;
|
|
|
|
if (response.find(key) != string::npos) {
|
|
|
|
if (response.find(key) != string::npos) {
|
|
|
@ -172,21 +170,16 @@ bool Quotas_sys::on_quota_sw(string partition, int mode) {
|
|
|
|
bool Quotas_sys::off_quota(string partition, string quota_hw, string quota_sw) {
|
|
|
|
bool Quotas_sys::off_quota(string partition, string quota_hw, string quota_sw) {
|
|
|
|
string cmd = "";
|
|
|
|
string cmd = "";
|
|
|
|
if (map_hw_or_sw.find(partition) != map_hw_or_sw.end()) {
|
|
|
|
if (map_hw_or_sw.find(partition) != map_hw_or_sw.end()) {
|
|
|
|
if (map_hw_or_sw[partition] == "hw") {
|
|
|
|
if (this->wrapper_hw_sw(partition) == "hw") {
|
|
|
|
cmd = quota_hw + " " + partition;
|
|
|
|
cmd = quota_hw + " " + partition;
|
|
|
|
|
|
|
|
obj_process_system.call(cmd, "");
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (map_hw_or_sw[partition] == "sw") {
|
|
|
|
else if (this->wrapper_hw_sw(partition) == "sw") {
|
|
|
|
cmd = quota_sw + " " + partition;
|
|
|
|
cmd = quota_sw + " " + partition;
|
|
|
|
|
|
|
|
obj_process_system.call(cmd, "");
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
|
|
|
|
// TODO:
|
|
|
|
|
|
|
|
// Убрать после тестирования
|
|
|
|
|
|
|
|
throw "Опа цэ!";
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
obj_process_system.call(cmd, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|