diff options
Diffstat (limited to 'utils/get-rd-token')
-rwxr-xr-x | utils/get-rd-token | 9 |
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; |