summaryrefslogtreecommitdiff
path: root/utils/rd-group
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-09-28 23:46:37 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2015-09-28 23:46:37 (GMT)
commit97c41e8f8472e02c379a495065a4432abd941971 (patch)
tree648fae623f8d07ee199bb28431d4fa3612616c43 /utils/rd-group
parentbcd58fdfc6d8496d5fa250aa8d6e0d0d3a89d49d (diff)
added rd-show
fixed debian package
Diffstat (limited to 'utils/rd-group')
-rwxr-xr-xutils/rd-group22
1 files changed, 11 insertions, 11 deletions
diff --git a/utils/rd-group b/utils/rd-group
index 1717caf..72c39e9 100755
--- a/utils/rd-group
+++ b/utils/rd-group
@@ -46,13 +46,13 @@ my ($dbh, undef, $errorstring) = RHRD::rddb::opendb();
if(defined $dbh) {
if($cmd eq "check") {
(my $result, my $status, $errorstring) = RHRD::rddb::check_group($dbh, $groupname);
- print "$result, $status: $errorstring\n";
+ print STDERR "$result, $status: $errorstring\n";
RHRD::rddb::closedb($dbh);
exit $result;
} elsif($cmd eq "add") {
(my $cnt, undef, $errorstring) = RHRD::rddb::add_group($dbh, $groupname, $ARGV[2]);
unless(defined $cnt) {
- print "$errorstring\n";
+ print STDERR "$errorstring\n";
RHRD::rddb::closedb($dbh);
exit 1;
}
@@ -60,7 +60,7 @@ if(defined $dbh) {
} elsif($cmd eq "remove") {
my @results = RHRD::rddb::remove_group($dbh, $groupname);
if(!defined $results[0] && defined $results[2]) {
- print "$results[2]\n";
+ print STDERR "$results[2]\n";
} else {
for my $href (@results) {
print int($href->{cnt}) . " " . $href->{name} . " deleted\n";
@@ -69,7 +69,7 @@ if(defined $dbh) {
} elsif($cmd eq "get-members") {
my @users = RHRD::rddb::get_group_members($dbh, $groupname);
if(!defined $users[0] && defined $users[1]) {
- print "$users[2]\n";
+ print STDERR "$users[2]\n";
RHRD::rddb::closedb($dbh);
exit 1;
}
@@ -79,7 +79,7 @@ if(defined $dbh) {
} elsif($cmd eq "add-member") {
(my $cnt, undef, $errorstring) = RHRD::rddb::add_group_member($dbh, $groupname, $ARGV[2]);
unless(defined $cnt) {
- print "$errorstring\n";
+ print STDERR "$errorstring\n";
RHRD::rddb::closedb($dbh);
exit 1;
}
@@ -87,7 +87,7 @@ if(defined $dbh) {
} elsif($cmd eq "remove-member") {
(my $cnt, undef, $errorstring) = RHRD::rddb::remove_group_member($dbh, $groupname, $ARGV[2]);
unless(defined $cnt) {
- print "$errorstring\n";
+ print STDERR "$errorstring\n";
RHRD::rddb::closedb($dbh);
exit 1;
}
@@ -96,7 +96,7 @@ if(defined $dbh) {
(my $cnt, undef, $errorstring) = RHRD::rddb::is_group_member($dbh, $groupname, $ARGV[2]);
RHRD::rddb::closedb($dbh);
unless(defined $cnt) {
- print "$errorstring\n";
+ print STDERR "$errorstring\n";
exit 1;
}
print $ARGV[2] . " is" . (($cnt) ? "" : " not") . " a member\n";
@@ -104,7 +104,7 @@ if(defined $dbh) {
} elsif($cmd eq "get-carts") {
my ($low, $high, $type, $enforce_range) = RHRD::rddb::get_group_carts($dbh, $groupname);
unless(defined $low) {
- print "$type\n";
+ print STDERR "$type\n";
RHRD::rddb::closedb($dbh);
exit 1;
}
@@ -112,7 +112,7 @@ if(defined $dbh) {
} elsif($cmd eq "set-carts") {
(my $cnt, undef, $errorstring) = RHRD::rddb::set_group_carts($dbh, $groupname, $ARGV[2], $ARGV[3], $ARGV[4], $ARGV[5]);
unless(defined $cnt) {
- print "$errorstring\n";
+ print STDERR "$errorstring\n";
RHRD::rddb::closedb($dbh);
exit 1;
}
@@ -120,7 +120,7 @@ if(defined $dbh) {
} elsif($cmd eq "get-reports") {
my ($nownext, $traffic, $music) = RHRD::rddb::get_group_reports($dbh, $groupname);
unless(defined $nownext) {
- print "$music\n";
+ print STDERR "$music\n";
RHRD::rddb::closedb($dbh);
exit 1;
}
@@ -128,7 +128,7 @@ if(defined $dbh) {
} elsif($cmd eq "set-reports") {
(my $cnt, undef, $errorstring) = RHRD::rddb::set_group_reports($dbh, $groupname, $ARGV[2], $ARGV[3], $ARGV[4]);
unless(defined $cnt) {
- print "$errorstring\n";
+ print STDERR "$errorstring\n";
RHRD::rddb::closedb($dbh);
exit 1;
}