You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.2 KiB

2 years ago
  1. // #include <curl/curl.h>
  2. #pragma once
  3. #include <fstream>
  4. #include <functional>
  5. #include <iostream>
  6. #include <list>
  7. #include <map>
  8. #include <memory>
  9. #include <set>
  10. #include <sstream>
  11. #include <string>
  12. #include <vector>
  13. #include "zlinuxcomponents/zmainhelper.hpp"
  14. //
  15. #include "configs/gconfig.hpp"
  16. #include "iflytopcpp/core/spdlogfactory/logger.hpp"
  17. #include "iflytopcpp/core/thread/thread.hpp"
  18. #include "version.hpp"
  19. #include "zlinuxcomponents/rootfs_auto_update/rootfs_auto_update.hpp"
  20. #include "zservice_container/zservice_container.hpp"
  21. //
  22. #include "service/main_control_service.hpp"
  23. namespace iflytop {
  24. using namespace iflytop;
  25. using namespace core;
  26. using namespace std;
  27. using namespace clipp;
  28. class Main {
  29. ENABLE_LOGGER(Main);
  30. private:
  31. unique_ptr<Thread> thread;
  32. private:
  33. int main(int argc, char *argv[]);
  34. public:
  35. static Main *g_main;
  36. static void _onsignal(int signo) { g_main->onsignal(signo); }
  37. void onsignal(int signo);
  38. public:
  39. Main(/* args */) {}
  40. ~Main() {}
  41. void run(int argc, char *argv[]);
  42. void updateRootfs();
  43. void dosystem(string order, bool dump) {
  44. if (dump) logger->info("{}", order);
  45. system(order.c_str());
  46. }
  47. };
  48. } // namespace iflytop