summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MANIFEST9
-rw-r--r--Makefile.PL2
-rw-r--r--debian/control7
-rw-r--r--debian/rhrd-utils.install7
-rwxr-xr-xutils/rhrd-group (renamed from utils/rd-group)0
-rwxr-xr-xutils/rhrd-sanity-check98
-rwxr-xr-xutils/rhrd-show (renamed from utils/rd-show)0
-rwxr-xr-xutils/rhrd-user (renamed from utils/rd-user)0
8 files changed, 112 insertions, 11 deletions
diff --git a/MANIFEST b/MANIFEST
index 6a4343f..684057c 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -7,8 +7,9 @@ MANIFEST
META.yml
utils/get-rd-token
utils/get-rd-week
-utils/rd-group
-utils/rd-show
-utils/rd-user
-utils/rhrd-ws-login
utils/update-rd-tokens
+utils/rhrd-group
+utils/rhrd-show
+utils/rhrd-user
+utils/rhrd-sanity-check
+utils/rhrd-ws-login
diff --git a/Makefile.PL b/Makefile.PL
index d71fe5a..7a1b2de 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,7 +1,7 @@
use ExtUtils::MakeMaker;
use 5.004;
-my @utils = qw(get-rd-token rhrd-ws-login get-rd-week update-rd-tokens rd-user rd-group rd-show);
+my @utils = qw(get-rd-token get-rd-week update-rd-tokens rhrd-user rhrd-group rhrd-show rhrd-ws-login rhrd-sanity-check);
WriteMakefile(
NAME => 'RHRD',
diff --git a/debian/control b/debian/control
index 69a12f8..b8ae9a5 100644
--- a/debian/control
+++ b/debian/control
@@ -20,10 +20,11 @@ Description: Radio Helsinki Rivendell Utilities
This package contains the following tools
* get-rd-token
* get-rd-week
- * rd-group
- * rd-show
- * rd-user
* update-rd-tokens
+ * rhrd-group
+ * rhrd-show
+ * rhrd-user
+ * rhrd-sanity-check
Package: rhrd-utils-ws
Architecture: all
diff --git a/debian/rhrd-utils.install b/debian/rhrd-utils.install
index 24e18cc..9828367 100644
--- a/debian/rhrd-utils.install
+++ b/debian/rhrd-utils.install
@@ -1,6 +1,7 @@
usr/bin/get-rd-token
usr/bin/get-rd-week
-usr/bin/rd-group
-usr/bin/rd-show
-usr/bin/rd-user
usr/bin/update-rd-tokens
+usr/bin/rhrd-group
+usr/bin/rhrd-show
+usr/bin/rhrd-user
+usr/bin/rhrd-sanity-check
diff --git a/utils/rd-group b/utils/rhrd-group
index 246d450..246d450 100755
--- a/utils/rd-group
+++ b/utils/rhrd-group
diff --git a/utils/rhrd-sanity-check b/utils/rhrd-sanity-check
new file mode 100755
index 0000000..ced1d30
--- /dev/null
+++ b/utils/rhrd-sanity-check
@@ -0,0 +1,98 @@
+#!/usr/bin/perl -w
+#
+# rhrdlibs
+#
+# Copyright (C) 2015 Christian Pointner <equinox@helsinki.at>
+#
+# This file is part of rhrdlibs.
+#
+# rhrdlibs is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# any later version.
+#
+# rhrdlibs 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with rhrdlibs. If not, see <http://www.gnu.org/licenses/>.
+#
+
+use strict;
+use lib "../lib/";
+use RHRD::rddb;
+
+# this is ridiculous but makes it a little harder to create/remove users...
+# if ($> != 0 ) {
+# print STDERR "this must be run as root!\n";
+# exit 1;
+# }
+
+sub print_usage
+{
+ print STDERR "Usage: rhrd-sanity-check\n";
+}
+
+my $num_args = $#ARGV + 1;
+if($num_args > 0) {
+ print_usage();
+ exit(1);
+}
+my $ret = 0;
+
+
+sub check_groups
+{
+ my ($ctx) = @_;
+
+ print "groups:\n";
+
+ my @groups = RHRD::rddb::list_groups($ctx);
+ if(!defined $groups[0] && defined $groups[1]) {
+ print STDERR "$groups[1]: $groups[2]";
+ return 1;
+ }
+ for my $group (@groups) {
+ next if($group eq $ctx->{'config'}{'specialgroups'}{'system'});
+ next if($group eq $ctx->{'config'}{'specialgroups'}{'shows'});
+ next if($group eq $ctx->{'config'}{'specialgroups'}{'allshows'});
+ next if($group eq $ctx->{'config'}{'specialgroups'}{'allpools'});
+ next if($group eq $ctx->{'config'}{'specialgroups'}{'alljingles'});
+ print " " . $group . "\n";
+ }
+ return 0;
+}
+
+sub check_logs
+{
+ my ($ctx) = @_;
+
+ print "logs:\n";
+ print " check not yet implemtned!!\n";
+}
+
+sub check_dropboxes
+{
+ my ($ctx) = @_;
+
+ print "dropboxes:\n";
+ print " check not yet implemtned!!\n";
+}
+
+my ($ctx, $status, $errorstring) = RHRD::rddb::init();
+if(defined $ctx) {
+ check_groups($ctx);
+ print "\n";
+ check_logs($ctx);
+ print "\n";
+ check_dropboxes($ctx);
+
+ RHRD::rddb::destroy($ctx);
+} else {
+ print STDERR "$errorstring\n";
+ $ret = 1;
+}
+
+exit $ret;
diff --git a/utils/rd-show b/utils/rhrd-show
index 0ad2426..0ad2426 100755
--- a/utils/rd-show
+++ b/utils/rhrd-show
diff --git a/utils/rd-user b/utils/rhrd-user
index 8689cb4..8689cb4 100755
--- a/utils/rd-user
+++ b/utils/rhrd-user