summaryrefslogtreecommitdiffstats
path: root/src/web/main.vala
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2018-07-17 20:59:04 +0200
committerSebastian Reichel <sre@ring0.de>2018-07-20 23:41:34 +0200
commit867fb84ffacbb02e44e2b6a511e61612dd2af3b1 (patch)
tree18cb2f39574370666d30eac2f581a45bfcdc891b /src/web/main.vala
parentfd24973c6996402269eece9049071a2064652592 (diff)
downloadserial-barcode-scanner-867fb84ffacbb02e44e2b6a511e61612dd2af3b1.tar.bz2
web: fix shortname
Diffstat (limited to 'src/web/main.vala')
-rw-r--r--src/web/main.vala30
1 files changed, 23 insertions, 7 deletions
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);