FrogPilot 0.9.7

This commit is contained in:
FrogAi
2024-06-27 10:22:08 -07:00
parent da00915ac8
commit b705b02e70
682 changed files with 181798 additions and 1348 deletions
+14
View File
@@ -271,4 +271,18 @@ std::string check_output(const std::string& command) {
return result;
}
bool system_time_valid() {
// Default to March 30, 2024
tm min_tm = {.tm_year = 2024 - 1900, .tm_mon = 2, .tm_mday = 30};
time_t min_date = mktime(&min_tm);
struct stat st;
if (stat("/lib/systemd/systemd", &st) == 0) {
min_date = std::max(min_date, st.st_mtime + 86400); // Add 1 day (86400 seconds)
}
return time(nullptr) > min_date;
}
} // namespace util