Add -v --version command line param to zmdc.pl

This commit is contained in:
Isaac Connor 2015-01-07 08:47:32 -05:00
parent 76d0dfa475
commit 94e0ec542a
1 changed files with 6 additions and 2 deletions

View File

@ -78,7 +78,7 @@ sub Usage
Usage: zmdc.pl <command> [daemon [options]]
Parameters are :-
<command> - One of 'startup|shutdown|status|check|logrot' or
'start|stop|restart|reload'.
'start|stop|restart|reload|version'.
[daemon [options]] - Daemon name and options, required for second group of commands
");
exit( -1 );
@ -90,7 +90,11 @@ if( !$command )
print( STDERR "No command given\n" );
Usage();
}
my $needs_daemon = $command !~ /(?:startup|shutdown|status|check|logrot)/;
if ( $command eq 'version' ) {
print ZoneMinder::Base::ZM_VERSION."\n";
exit( 0 );
}
my $needs_daemon = $command !~ /(?:startup|shutdown|status|check|logrot|version)/;
my $daemon = shift( @ARGV );
if( $needs_daemon && !$daemon )
{