[X2Go-Commits] [x2goserver] 01/03: x2goserver/lib: new wrapper script x2goqueryconfig to fetch a config value out of the global x2goserver.conf file.

git-admin at x2go.org git-admin at x2go.org
Mon Jan 1 06:12:00 CET 2018


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch release/4.0.1.x
in repository x2goserver.

commit 6e1ea9e72568d4c317481fad09245a012b02096d
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Mon Jan 1 05:09:36 2018 +0100

    x2goserver/lib: new wrapper script x2goqueryconfig to fetch a config value out of the global x2goserver.conf file.
---
 debian/changelog               |  2 ++
 x2goserver/lib/x2goqueryconfig | 46 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 967fbe2..519e2f9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ x2goserver (4.0.1.23-0x2go1) UNRELEASED; urgency=medium
   * New upstream version (4.0.1.23):
     - x2goserver/bin/x2gostartagent: reenable XFIXES extension. The initial
       problem that required this workaround has been fixed a long time ago.
+    - x2goserver/lib: new wrapper script x2goqueryconfig to fetch a config
+      value out of the global x2goserver.conf file.
   * x2goserver.spec:
     - RPMify x2goserver-xsession description.
     - Remove qt4 stuff, we're not using the framework here.
diff --git a/x2goserver/lib/x2goqueryconfig b/x2goserver/lib/x2goqueryconfig
new file mode 100755
index 0000000..c67a7fe
--- /dev/null
+++ b/x2goserver/lib/x2goqueryconfig
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2017-2018 X2Go Project - https://wiki.x2go.org
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+use strict;
+
+use Config::Simple;
+
+my $section = shift or die "Missing section argument";
+my $key = shift or die "Missing key argument";
+
+if (!(length ($section))) {
+  die "Invalid (empty) section argument";
+}
+
+if (!(length ($key))) {
+  die "Invalid (empty) key argument";
+}
+
+my $Config = new Config::Simple (syntax => 'ini');
+$Config->read ('/etc/x2go/x2goserver.conf');
+
+my $val = $Config->param("$section.$key");
+
+if (defined ($val)) {
+  print "$val\n";
+  exit 0;
+}
+else {
+  exit 1;
+}

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git


More information about the x2go-commits mailing list