[X2Go-Commits] [x2goserver] 01/33: 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
Wed Jan 10 00:19:23 CET 2018


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

x2go pushed a commit to branch master
in repository x2goserver.

commit dfa3f084921473606501869cc7ceb9907107c9c8
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.
    
    Cherry-picked from release/4.0.1.x branch.
---
 debian/changelog               |  2 ++
 x2goserver/lib/x2goqueryconfig | 45 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index cca63be..1a41d48 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -263,6 +263,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..7d0fa9d
--- /dev/null
+++ b/x2goserver/lib/x2goqueryconfig
@@ -0,0 +1,45 @@
+#!/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 X2Go::Config qw (get_config);
+
+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 = get_config ();
+
+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