MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
controller_updater.h
Go to the documentation of this file.
1 
4 #include <string>
5 
6 #ifndef SHARED_SECRET
7 #define SHARED_SECRET "empty"
8 #endif
9 
10 namespace Controller {
11  extern bool restarting;
12  extern JSON::Value updates;
13  extern std::string uniqId;
14 
15  std::string readFile(std::string filename);
16  bool writeFile(std::string filename, std::string & contents);
18  void CheckUpdates();
19  void updateComponent(const std::string & component, const std::string & md5sum, Socket::Connection & updrConn);
20 
21 } //Controller namespace
JSON::Value updates
Definition: controller_updater.cpp:22
Holds everything unique to the controller.
Definition: controller_api.h:4
A JSON::Value is either a string or an integer, but may also be an object, array or null...
Definition: json.h:21
void CheckUpdates()
Calls CheckUpdateInfo(), uses the resulting JSON::Value to download any needed updates.
Definition: controller_updater.cpp:160
bool restarting
Signals if the controller is shutting down (false) or restarting (true).
Definition: controller_updater.cpp:21
JSON::Value CheckUpdateInfo()
Definition: controller_updater.cpp:70
void updateComponent(const std::string &component, const std::string &md5sum, Socket::Connection &updrConn)
Attempts to download an update for the listed component.
Definition: controller_updater.cpp:197
std::string readFile(std::string filename)
Definition: controller_updater.cpp:25
bool writeFile(std::string filename, std::string &contents)
Definition: controller_updater.cpp:43
std::string uniqId
Definition: controller_updater.cpp:23
This class is for easy communicating through sockets, either TCP or Unix.
Definition: socket.h:47