allow running sbin scripts from any directory

This commit is contained in:
Graham Knop 2010-04-15 14:02:39 -05:00
parent 8206aeaec5
commit aaa0924dc7
18 changed files with 310 additions and 255 deletions

View file

@ -10,15 +10,19 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
$|++; # disable output buffering use strict;
our ($webguiRoot, $configFile, $help, $man); use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN { BEGIN {
$webguiRoot = ".."; $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift (@INC, $webguiRoot."/lib"); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
use strict; $|++; # disable output buffering
our ($configFile, $help, $man);
use Pod::Usage; use Pod::Usage;
use Getopt::Long; use Getopt::Long;
use WebGUI::Session; use WebGUI::Session;

View file

@ -1,185 +1,187 @@
#!/usr/bin/env perl #!/usr/bin/env perl
#------------------------------------------------------------------- #-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation. # WebGUI is Copyright 2001-2009 Plain Black Corporation.
#------------------------------------------------------------------- #-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license # Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using # (docs/license.txt) that came with this distribution before using
# this software. # this software.
#------------------------------------------------------------------- #-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
our ($webguiRoot); use strict;
use File::Basename ();
BEGIN { use File::Spec;
$webguiRoot = "..";
unshift (@INC, $webguiRoot."/lib"); my $webguiRoot;
} BEGIN {
$webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
use Getopt::Long; unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
use Pod::Usage; }
use strict;
use WebGUI::Session; use Getopt::Long;
use WebGUI::User; use Pod::Usage;
use WebGUI::Inbox; use WebGUI::Session;
use WebGUI::User;
$|=1; use WebGUI::Inbox;
my $configFile; $|=1;
my $help;
my $quiet; my $configFile;
my $whatsHappening = "Automatically signed out."; my $help;
my $newStatus = "Out"; my $quiet;
my $currentStatus = "In"; my $whatsHappening = "Automatically signed out.";
my $userMessage = "You were logged out of the In/Out Board automatically."; my $newStatus = "Out";
my $userMessageFile; my $currentStatus = "In";
my $userMessage = "You were logged out of the In/Out Board automatically.";
my $userMessageFile;
GetOptions(
'configfile=s'=>\$configFile,
'help'=>\$help, GetOptions(
'quiet'=>\$quiet, 'configfile=s'=>\$configFile,
'whatsHappening:s'=>\$whatsHappening, 'help'=>\$help,
'userMessage:s'=>\$userMessage, 'quiet'=>\$quiet,
'userMessageFile:s'=>\$userMessageFile, 'whatsHappening:s'=>\$whatsHappening,
'currentStatus:s'=>\$currentStatus, 'userMessage:s'=>\$userMessage,
'newStatus:s'=>\$newStatus 'userMessageFile:s'=>\$userMessageFile,
); 'currentStatus:s'=>\$currentStatus,
'newStatus:s'=>\$newStatus
pod2usage( verbose => 2 ) if $help; );
pod2usage() unless $configFile;
pod2usage( verbose => 2 ) if $help;
print "Starting up...\n" unless ($quiet); pod2usage() unless $configFile;
my $session = WebGUI::Session->open($webguiRoot,$configFile);
print "Starting up...\n" unless ($quiet);
if ($userMessageFile) { my $session = WebGUI::Session->open($webguiRoot,$configFile);
print "Opening message file.." unless ($quiet);
if (open(FILE,"<".$userMessageFile)) { if ($userMessageFile) {
print "OK\n" unless ($quiet); print "Opening message file.." unless ($quiet);
my $contents; if (open(FILE,"<".$userMessageFile)) {
while (<FILE>) { print "OK\n" unless ($quiet);
$contents .= $_; my $contents;
} while (<FILE>) {
close(FILE); $contents .= $_;
if (length($contents) == 0) { }
print "Message file empty, reverting to original message.\n"; close(FILE);
} else { if (length($contents) == 0) {
$userMessage = $contents; print "Message file empty, reverting to original message.\n";
} } else {
} else { $userMessage = $contents;
print "Failed to open message file.\n"; }
} } else {
} print "Failed to open message file.\n";
}
print "Searching for users with a status of $currentStatus ...\n" unless ($quiet); }
my $userList;
my $now = time(); print "Searching for users with a status of $currentStatus ...\n" unless ($quiet);
my $inbox = WebGUI::Inbox->new($session); my $userList;
my $sth = $session->db->read("select userId,assetId from InOutBoard_status where status=?",[$currentStatus]); my $now = time();
while (my ($userId,$assetId) = $sth->array) { my $inbox = WebGUI::Inbox->new($session);
my $user = WebGUI::User->new($session, $userId); my $sth = $session->db->read("select userId,assetId from InOutBoard_status where status=?",[$currentStatus]);
print "\tFound user ".$user->username."\n" unless ($quiet); while (my ($userId,$assetId) = $sth->array) {
$userList .= $user->username." (".$userId.")\n"; my $user = WebGUI::User->new($session, $userId);
$session->db->write("update InOutBoard_status set dateStamp=?, message=?, status=? where userId=? and assetId=?",[$now, $whatsHappening, $newStatus, $userId, $assetId]); print "\tFound user ".$user->username."\n" unless ($quiet);
$session->db->write("insert into InOutBoard_statusLog (userId, createdBy, dateStamp, message, status, assetId) values (?,?,?,?,?,?)", $userList .= $user->username." (".$userId.")\n";
[$userId,3,$now, $whatsHappening, $newStatus, $assetId]); $session->db->write("update InOutBoard_status set dateStamp=?, message=?, status=? where userId=? and assetId=?",[$now, $whatsHappening, $newStatus, $userId, $assetId]);
$inbox->addMessage({ $session->db->write("insert into InOutBoard_statusLog (userId, createdBy, dateStamp, message, status, assetId) values (?,?,?,?,?,?)",
userId=>$userId, [$userId,3,$now, $whatsHappening, $newStatus, $assetId]);
subject=>"IOB Update", $inbox->addMessage({
message=>$userMessage userId=>$userId,
}); subject=>"IOB Update",
} message=>$userMessage
});
if (length($userList) > 0) { }
print "Alerting admins of changes\n" unless ($quiet);
my $message = "The following users had their status changed:\n\n".$userList; if (length($userList) > 0) {
$inbox->addMessage({ print "Alerting admins of changes\n" unless ($quiet);
groupId=>3, my $message = "The following users had their status changed:\n\n".$userList;
subject=>"IOB Update", $inbox->addMessage({
message=>$userMessage groupId=>3,
}); subject=>"IOB Update",
} message=>$userMessage
});
print "Cleaning up..." unless ($quiet); }
$session->var->end;
$session->close; print "Cleaning up..." unless ($quiet);
print "OK\n" unless ($quiet); $session->var->end;
$session->close;
__END__ print "OK\n" unless ($quiet);
=head1 NAME __END__
changeIobStatus - Automate WebGUI's InOut Board User status switching. =head1 NAME
=head1 SYNOPSIS changeIobStatus - Automate WebGUI's InOut Board User status switching.
changeIobStatus --configFile config.conf =head1 SYNOPSIS
[--currentStatus status]
[--newStatus status] changeIobStatus --configFile config.conf
[--userMessage text|--userMessageFile pathname] [--currentStatus status]
[--whatsHappening text] [--newStatus status]
[--quiet] [--userMessage text|--userMessageFile pathname]
[--whatsHappening text]
changeIobStatus --help [--quiet]
=head1 DESCRIPTION changeIobStatus --help
This WebGUI utility script helps you switch one or more user status =head1 DESCRIPTION
in the InOut Board (IOB). For instance, you might want to run it
from cron each night to automatically mark out all users that haven't This WebGUI utility script helps you switch one or more user status
already marked out. in the InOut Board (IOB). For instance, you might want to run it
from cron each night to automatically mark out all users that haven't
=over already marked out.
=item B<--configFile config.conf> =over
The WebGUI config file to use. Only the file name needs to be specified, =item B<--configFile config.conf>
since it will be looked up inside WebGUI's configuration directory.
This parameter is required. The WebGUI config file to use. Only the file name needs to be specified,
since it will be looked up inside WebGUI's configuration directory.
=item B<--currentStatus status> This parameter is required.
Check users in the IOB having B<status> status. If left unspecified, =item B<--currentStatus status>
it will default to C<In>.
Check users in the IOB having B<status> status. If left unspecified,
=item B<--newStatus status> it will default to C<In>.
Change users status in the IOB to B<status> status. If left unspecified, =item B<--newStatus status>
it will default to C<Out>.
Change users status in the IOB to B<status> status. If left unspecified,
=item B<--userMessage msg> it will default to C<Out>.
Text of the message to be sent to the user after changing the status. =item B<--userMessage msg>
If left unspecified it will default to
Text of the message to be sent to the user after changing the status.
You were logged out of the In/Out Board automatically. If left unspecified it will default to
=item B<--userMessageFile pathname> You were logged out of the In/Out Board automatically.
Pathname to a file whose contents will be sent to the user after changing =item B<--userMessageFile pathname>
the status. Using this option overrides whatever messages is set
with B<--userMessage> (see above). Pathname to a file whose contents will be sent to the user after changing
the status. Using this option overrides whatever messages is set
=item B<--whatsHappening text> with B<--userMessage> (see above).
The message attached to the InOut Board when changing status. If left =item B<--whatsHappening text>
unspecified it defaults to
The message attached to the InOut Board when changing status. If left
Automatically signed out. unspecified it defaults to
=item B<--quiet> Automatically signed out.
Disable all output unless there's an error. =item B<--quiet>
=item B<--help> Disable all output unless there's an error.
Shows this documentation, then exits. =item B<--help>
=back Shows this documentation, then exits.
=head1 AUTHOR =back
Copyright 2001-2009 Plain Black Corporation. =head1 AUTHOR
=cut Copyright 2001-2009 Plain Black Corporation.
=cut

View file

@ -10,16 +10,18 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
our ($webguiRoot); use strict;
use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN { BEGIN {
$webguiRoot = ".."; $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift (@INC, $webguiRoot."/lib"); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
use Getopt::Long; use Getopt::Long;
use Pod::Usage; use Pod::Usage;
use strict;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Asset; use WebGUI::Asset;

View file

@ -10,15 +10,17 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
our ($webguiRoot, @nailable); use strict;
use File::Basename ();
use File::Spec;
BEGIN { my $webguiRoot;
$webguiRoot = ".."; BEGIN {
@nailable = qw(jpg jpeg png gif); $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift (@INC, $webguiRoot."/lib"); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
my @nailable = qw(jpg jpeg png gif);
$| = 1; $| = 1;
use File::Path; use File::Path;
@ -27,7 +29,6 @@ use FileHandle;
use Getopt::Long; use Getopt::Long;
use POSIX; use POSIX;
use Pod::Usage; use Pod::Usage;
use strict;
use WebGUI::Asset::File; use WebGUI::Asset::File;
use WebGUI::Asset::File::Image; use WebGUI::Asset::File::Image;
use WebGUI::Session; use WebGUI::Session;

View file

@ -10,9 +10,17 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
# ------------------------------------------------------------------- # -------------------------------------------------------------------
$|=1;
use lib '../lib';
use strict; use strict;
use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN {
$webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
}
$|=1;
use Carp qw( carp croak ); use Carp qw( carp croak );
use File::Find; use File::Find;
use Getopt::Long; use Getopt::Long;

View file

@ -10,19 +10,21 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
use strict;
our $webguiRoot; use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN { BEGIN {
$webguiRoot = ".."; $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift (@INC, $webguiRoot."/lib"); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
use DBI; use DBI;
use FileHandle; use FileHandle;
use Getopt::Long; use Getopt::Long;
use Pod::Usage; use Pod::Usage;
use strict qw(subs vars); no strict 'refs';
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Asset; use WebGUI::Asset;

View file

@ -11,8 +11,16 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
use lib "../lib";
use strict; use strict;
use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN {
$webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
}
use Getopt::Long; use Getopt::Long;
use Pod::Usage; use Pod::Usage;
use WebGUI::Pluggable; use WebGUI::Pluggable;

View file

@ -10,17 +10,18 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
use strict;
use File::Basename ();
use File::Spec;
our ($webguiRoot); my $webguiRoot;
BEGIN { BEGIN {
$webguiRoot = ".."; $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift (@INC, $webguiRoot."/lib"); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
use Getopt::Long; use Getopt::Long;
use Pod::Usage; use Pod::Usage;
use strict;
use WebGUI::Session; use WebGUI::Session;
my $help; my $help;

View file

@ -10,14 +10,16 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
our ($webguiRoot); use strict;
use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN { BEGIN {
$webguiRoot = ".."; $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift (@INC, $webguiRoot."/lib"); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
use strict;
use Getopt::Long; use Getopt::Long;
use Pod::Usage; use Pod::Usage;
use WebGUI::Config; use WebGUI::Config;

View file

@ -10,19 +10,20 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
our ($webguiRoot); use strict;
use File::Basename ();
use File::Spec;
BEGIN { my $webguiRoot;
$webguiRoot = ".."; BEGIN {
unshift (@INC, $webguiRoot."/lib"); $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
$| = 1; $| = 1;
use Getopt::Long; use Getopt::Long;
use Pod::Usage; use Pod::Usage;
use strict;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Utility; use WebGUI::Utility;

View file

@ -10,14 +10,16 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
our ($webguiRoot); use strict;
use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN { BEGIN {
$webguiRoot = ".."; $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift (@INC, $webguiRoot."/lib"); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
use strict;
use Getopt::Long; use Getopt::Long;
use WebGUI::Asset; use WebGUI::Asset;
use WebGUI::Config; use WebGUI::Config;

View file

@ -10,15 +10,17 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
our ($webguiRoot); use strict;
use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN { BEGIN {
$webguiRoot = ".."; $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift (@INC, $webguiRoot."/lib"); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
use Pod::Usage; use Pod::Usage;
use strict;
use warnings; use warnings;
use Getopt::Long; use Getopt::Long;
use POE::Component::IKC::ClientLite; use POE::Component::IKC::ClientLite;

12
sbin/syncToCdn.pl Normal file → Executable file
View file

@ -1,3 +1,5 @@
#!/usr/bin/env perl
#------------------------------------------------------------------- #-------------------------------------------------------------------
# WebGUI is Copyright 2001-2009 Plain Black Corporation. # WebGUI is Copyright 2001-2009 Plain Black Corporation.
#------------------------------------------------------------------- #-------------------------------------------------------------------
@ -8,14 +10,16 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
our $webguiRoot; use strict;
use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN { BEGIN {
$webguiRoot = ".."; $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift( @INC, $webguiRoot . "/lib" ); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
use strict;
use Fcntl ':flock'; use Fcntl ':flock';
use Getopt::Long; use Getopt::Long;
use WebGUI::Session; use WebGUI::Session;

View file

@ -10,9 +10,18 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
use strict;
use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN {
$webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
}
$|=1; $|=1;
use strict;
use FindBin; use FindBin;
use File::Spec qw[]; use File::Spec qw[];
use Getopt::Long; use Getopt::Long;
@ -48,14 +57,13 @@ if (! -e $configFile) {
##Probably given the name of the config file with no path, ##Probably given the name of the config file with no path,
##attempt to prepend the path to it. ##attempt to prepend the path to it.
warn "Config file $configFile does not exist, assuming that you supplied a bare config and are running from inside the sbin directory\n"; warn "Config file $configFile does not exist, assuming that you supplied a bare config and are running from inside the sbin directory\n";
$configFile = File::Spec->canonpath($FindBin::Bin.'/../etc/'.$configFile); $configFile = File::Spec->canonpath($webguiRoot . '/etc/' . $configFile);
} }
die "Unable to use $configFile as a WebGUI config file\n" die "Unable to use $configFile as a WebGUI config file\n"
unless(-e $configFile and -f _); unless(-e $configFile and -f _);
my (undef, $directories, $file) = File::Spec->splitpath($configFile); my (undef, $directories, $file) = File::Spec->splitpath($configFile);
my $webguiRoot = File::Spec->canonpath(File::Spec->catdir($directories, File::Spec->updir));
my $webguiTest = File::Spec->catdir($webguiRoot, 't'); my $webguiTest = File::Spec->catdir($webguiRoot, 't');
my $prefix = "WEBGUI_CONFIG=".$configFile; my $prefix = "WEBGUI_CONFIG=".$configFile;

View file

@ -10,15 +10,16 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
use strict;
use File::Basename ();
use File::Spec;
our $webguiRoot; my $webguiRoot;
BEGIN { BEGIN {
$webguiRoot = ".."; $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift (@INC, $webguiRoot."/lib"); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
use strict;
use CPAN; use CPAN;
use Getopt::Long; use Getopt::Long;
use Pod::Usage; use Pod::Usage;

View file

@ -10,11 +10,14 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
our ($webguiRoot); use strict;
use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN { BEGIN {
$webguiRoot = ".."; $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift (@INC, $webguiRoot."/lib"); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
#----------------------------------------- #-----------------------------------------

View file

@ -10,14 +10,16 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
our ($webguiRoot); use strict;
use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN { BEGIN {
$webguiRoot = ".."; $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift (@INC, $webguiRoot."/lib"); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
use strict;
use Cwd (); use Cwd ();
use File::Path (); use File::Path ();
use Getopt::Long (); use Getopt::Long ();

View file

@ -10,14 +10,16 @@
# http://www.plainblack.com info@plainblack.com # http://www.plainblack.com info@plainblack.com
#------------------------------------------------------------------- #-------------------------------------------------------------------
our ($webguiRoot); use strict;
use File::Basename ();
use File::Spec;
my $webguiRoot;
BEGIN { BEGIN {
$webguiRoot = ".."; $webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
unshift (@INC, $webguiRoot."/lib"); unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
} }
use strict;
use Digest::MD5; use Digest::MD5;
use Getopt::Long; use Getopt::Long;
use Pod::Usage; use Pod::Usage;