summaryrefslogtreecommitdiff
path: root/rt/sbin/rt-clean-sessions
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-06-07 00:56:06 -0700
committerIvan Kohler <ivan@freeside.biz>2012-06-07 00:56:06 -0700
commit43a06151e47d2c59b833cbd8c26d97865ee850b6 (patch)
tree42c51d94e7fa265461b508d061562be204ccc2c1 /rt/sbin/rt-clean-sessions
parent6587f6ba7d047ddc1686c080090afe7d53365bd4 (diff)
starting to work...
Diffstat (limited to 'rt/sbin/rt-clean-sessions')
-rwxr-xr-xrt/sbin/rt-clean-sessions26
1 files changed, 13 insertions, 13 deletions
diff --git a/rt/sbin/rt-clean-sessions b/rt/sbin/rt-clean-sessions
index c3dc20143..6189c4683 100755
--- a/rt/sbin/rt-clean-sessions
+++ b/rt/sbin/rt-clean-sessions
@@ -3,7 +3,7 @@
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@ -52,7 +52,7 @@ use warnings;
# fix lib paths, some may be relative
BEGIN {
require File::Spec;
- my @libs = ("lib", "local/lib");
+ my @libs = ("/opt/rt3/lib", "/opt/rt3/local/lib");
my $bin_path;
for my $lib (@libs) {
@@ -75,14 +75,13 @@ BEGIN {
use Getopt::Long;
my %opt;
-GetOptions( \%opt, "older=s", "debug", "help", "skip-user");
+GetOptions( \%opt, "older=s", "debug", "help|h", "skip-user" );
if ( $opt{help} ) {
require Pod::Usage;
- import Pod::Usage;
- pod2usage({ -message => "RT Session cleanup tool\n", verbose => 1 });
- exit 1;
+ Pod::Usage::pod2usage({ verbose => 2 });
+ exit;
}
@@ -113,7 +112,8 @@ RT::InitLogging();
require RT::Interface::Web::Session;
-if( $opt{'older'} or my $alogoff = int RT->Config->Get('AutoLogoff') ) {
+my $alogoff = int RT->Config->Get('AutoLogoff');
+if ( $opt{'older'} or $alogoff ) {
my $min;
foreach ($alogoff*60, $opt{'older'}) {
next unless $_;
@@ -137,13 +137,13 @@ rt-clean-sessions - clean old and duplicate RT sessions
=head1 SYNOPSIS
- rt-clean-sessions [--debug] [--older <NUM>[H|D|M|Y]]
+ rt-clean-sessions [--debug] [--older <NUM>[H|D|M|Y]]
- rt-clean-sessions
- rt-clean-sessions --debug
- rt-clean-sessions --older 10D
- rt-clean-sessions --debug --older 1M
- rt-clean-sessions --older 10D --skip-user
+ rt-clean-sessions
+ rt-clean-sessions --debug
+ rt-clean-sessions --older 10D
+ rt-clean-sessions --debug --older 1M
+ rt-clean-sessions --older 10D --skip-user
=head1 DESCRIPTION