From 867fb84ffacbb02e44e2b6a511e61612dd2af3b1 Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Tue, 17 Jul 2018 20:59:04 +0200 Subject: web: fix shortname --- src/web/main.vala | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'src/web/main.vala') diff --git a/src/web/main.vala b/src/web/main.vala index 2043df0..761bba9 100644 --- a/src/web/main.vala +++ b/src/web/main.vala @@ -19,6 +19,7 @@ public PGP pgp; public Config cfg; public AudioPlayer audio; string templatedir; +string? shortname; public static int main(string[] args) { Intl.setlocale(LocaleCategory.ALL, ""); @@ -37,13 +38,6 @@ public static int main(string[] args) { var datapath = cfg.get_string("GENERAL", "datapath"); templatedir = Path.build_filename(datapath, "templates"); port = cfg.get_integer("WEB", "port"); - - try { - certificate = cfg.get_string("WEB", "cert"); - privatekey = cfg.get_string("WEB", "key"); - } catch(KeyFileError e) { - warning(_("KeyFile Error: %s\n"), e.message); - } } catch(IOError e) { error(_("IO Error: %s\n"), e.message); } catch(KeyFileError e) { @@ -52,6 +46,28 @@ public static int main(string[] args) { error(_("DBus Error: %s\n"), e.message); } + try { + certificate = cfg.get_string("WEB", "cert"); + privatekey = cfg.get_string("WEB", "key"); + } catch(KeyFileError e) { + warning(_("KeyFile Error: %s\n"), e.message); + } catch(IOError e) { + error(_("IO Error: %s\n"), e.message); + } catch(DBusError e) { + error(_("DBus Error: %s\n"), e.message); + } + + try { + shortname = cfg.get_string("GENERAL", "shortname"); + } catch(KeyFileError e) { + shortname = ""; + warning(_("KeyFile Error: %s\n"), e.message); + } catch(IOError e) { + error(_("IO Error: %s\n"), e.message); + } catch(DBusError e) { + error(_("DBus Error: %s\n"), e.message); + } + stdout.printf(_("Web Server Port: %u\n"), port); stdout.printf(_("TLS certificate: %s\n"), certificate); stdout.printf(_("TLS private key: %s\n"), privatekey); -- cgit v1.2.3