summaryrefslogtreecommitdiff
path: root/utils/get-rd-token
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-09-30 15:07:41 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2015-09-30 15:07:41 (GMT)
commit5897b1bc3b059a29f57bde6c08344deceb41bd23 (patch)
treef2ca2ba16403ac0d65286fc1b5e3d9783440b32b /utils/get-rd-token
parentefb5d6557591ef21c27aa46aae220d862c36feeb (diff)
major cleanup for all utils
Diffstat (limited to 'utils/get-rd-token')
-rwxr-xr-xutils/get-rd-token9
1 files changed, 5 insertions, 4 deletions
diff --git a/utils/get-rd-token b/utils/get-rd-token
index 6965cab..b2b4dce 100755
--- a/utils/get-rd-token
+++ b/utils/get-rd-token
@@ -44,20 +44,21 @@ if($num_args == 1) {
}
my $token='';
+my $ret = 0;
my ($dbh, undef, $errorstring) = RHRD::rddb::opendb();
if(defined $dbh) {
($token, undef, $errorstring) = RHRD::rddb::get_token($dbh, $requsername);
unless($token) {
print STDERR "$errorstring\n";
- exit 1;
+ $ret = 1;
}
RHRD::rddb::closedb($dbh);
} else {
print STDERR "$errorstring\n";
- exit 1;
+ $ret = 1;
}
-print "$token\n";
+print "$token\n" if $token;
-exit 0
+exit $ret;