2 * @brief The main function.
6 * @copyright Intra2net AG
22 #include <boost/foreach.hpp>
24 #include "updater.cpp"
27 #include "service.cpp"
34 typedef boost::shared_ptr<Config> ConfigPtr;
35 typedef boost::shared_ptr<Updater> UpdaterPtr;
38 * @brief The main part.
39 * @param argc Number of arguments
40 * @param argv Command line arguments
41 * @return 0 if all is fine.
43 int main(int argc, char *argv[])
45 // Initialize Config class and get the command line parameters
46 ConfigPtr config(new Config);
47 int ret_val = config->parse_cmd_line(argc,argv);
51 config->print_usage();
57 ostringstream version_string;
58 version_string << VERSION << "." << REVISION << "." << RELEASE;
59 config->print_version(version_string.str());
63 // Load the main config and the service files
64 string config_path = "/home/bjoern/bpdyndnsd"; // TODO: standard config path should be /etc/bpdyndnsd if not specified other on command line
65 ret_val = config->load_config_from_files(config_path);
69 cout << "See manpage for config file structure." << endl;
79 UpdaterPtr updater(new Updater(config));
80 updater->update_services();