X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fpb-discover.c;h=e2b36dd499e623ec63caf752c0cc0cc844c393f3;hp=e895f47653945fcef31fc888e2473d632cc21000;hb=336f4eb17fb50526ea9fda82262356581e1b9ae0;hpb=ae3c354e844698bdb4ed35a6845aa9dca1e9205f diff --git a/discover/pb-discover.c b/discover/pb-discover.c index e895f47..e2b36dd 100644 --- a/discover/pb-discover.c +++ b/discover/pb-discover.c @@ -7,12 +7,14 @@ #include #include #include +#include #include #include #include #include #include +#include #include "discover-server.h" #include "device-handler.h" @@ -127,6 +129,10 @@ int main(int argc, char *argv[]) struct opts opts; FILE *log; + setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); + if (opts_parse(&opts, argc, argv)) { print_usage(); return EXIT_FAILURE; @@ -153,7 +159,7 @@ int main(int argc, char *argv[]) } pb_log_init(log); - if (opts.verbose) + if (opts.verbose == opt_yes) pb_log_set_debug(true); pb_log("--- pb-discover ---\n"); @@ -177,6 +183,15 @@ int main(int argc, char *argv[]) if (opts.no_autoboot == opt_yes) config_set_autoboot(false); + if (config_get()->lang) + setlocale(LC_ALL, config_get()->lang); + + if (config_get()->debug) + pb_log_set_debug(true); + + if (platform_restrict_clients()) + discover_server_set_auth_mode(server, true); + system_info_init(server); handler = device_handler_init(server, waitset, opts.dry_run == opt_yes);