Removed dependancy on Term::Readkey
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@594 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
06c13211c7
commit
dfef873c08
|
@ -74,7 +74,6 @@ use constant VERBOSE => 0; # Whether to output more verbose debug
|
||||||
use strict;
|
use strict;
|
||||||
use DBI;
|
use DBI;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use Term::ReadKey;
|
|
||||||
|
|
||||||
$| = 1;
|
$| = 1;
|
||||||
|
|
||||||
|
@ -112,22 +111,16 @@ sub confirm
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print( ", delete y/n: " );
|
print( ", delete y/n: " );
|
||||||
my $char = ReadKey( 0 );
|
my $char = <>;
|
||||||
#print( "C:'".ord($char)."'\n" );
|
chomp( $char );
|
||||||
if ( $char eq 'q' )
|
if ( $char eq 'q' )
|
||||||
{
|
{
|
||||||
print( "\n" );
|
|
||||||
ReadMode( 'restore' );
|
|
||||||
exit( 0 );
|
exit( 0 );
|
||||||
}
|
}
|
||||||
if ( ord($char) == 10 )
|
if ( !$char )
|
||||||
{
|
{
|
||||||
$char = 'y';
|
$char = 'y';
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
print( "$char\n" );
|
|
||||||
}
|
|
||||||
if ( $char eq "a" )
|
if ( $char eq "a" )
|
||||||
{
|
{
|
||||||
$yes = 1;
|
$yes = 1;
|
||||||
|
@ -152,10 +145,6 @@ if ( $report && $yes )
|
||||||
my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_SERVER, ZM_DB_USERA, ZM_DB_PASSA );
|
my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_SERVER, ZM_DB_USERA, ZM_DB_PASSA );
|
||||||
|
|
||||||
chdir( EVENT_PATH );
|
chdir( EVENT_PATH );
|
||||||
if ( !$yes && !$report )
|
|
||||||
{
|
|
||||||
ReadMode( 'cbreak' );
|
|
||||||
}
|
|
||||||
if ( $delay ) # Background mode
|
if ( $delay ) # Background mode
|
||||||
{
|
{
|
||||||
open( LOG, ">>".LOG_FILE ) or die( "Can't open log file: $!" );
|
open( LOG, ">>".LOG_FILE ) or die( "Can't open log file: $!" );
|
||||||
|
@ -310,7 +299,3 @@ do
|
||||||
|
|
||||||
sleep( $delay ) if ( $delay );
|
sleep( $delay ) if ( $delay );
|
||||||
} while( $delay );
|
} while( $delay );
|
||||||
if ( !$yes && !$report )
|
|
||||||
{
|
|
||||||
ReadMode( 'restore' );
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue