2 * @brief The updater class implementation. This class implements the updater logic.
6 * @copyright Intra2net AG
12 #include <boost/foreach.hpp>
16 * Default constructor which initializes the member Conf.
25 * @param _conf A pointer to a Config object.
27 Updater::Updater(ConfigPtr _conf)
38 cout << "Updater destructor!!!" << endl;
48 const int Updater::init_config_from_cmd(int argc, char *argv[])
50 // Load the command line parameters
51 int ret_val = Conf->parse_cmd_line(argc,argv);
61 ostringstream version_string;
62 version_string << VERSION << "." << REVISION << "." << RELEASE;
63 Conf->print_version(version_string.str());
67 Conf->print_cmd_parsed();
71 const int Updater::init_config_from_files()
73 // Load the main config and the service files
74 string config_path = "/home/bjoern/bpdyndnsd"; // TODO: standard config path should be /etc/bpdyndnsd if not specified other on command line
75 int ret_val = Conf->load_config_from_files(config_path);
79 Conf->print_unknown_conf_option();
85 Conf->print_error_opening();
89 Conf->print_conf_loaded();
95 * Setter for member Conf.
98 void Updater::set_config(ConfigPtr _conf)
105 * Getter for member Conf.
108 ConfigPtr Updater::get_config()
115 * Update all configured services.
117 void Updater::update_services()
119 list<ServicePtr> services = this->Conf->get_services();
121 string ip = "192.168.1.1";
123 BOOST_FOREACH( ServicePtr service, services )