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]] Usage: zmdc.pl <command> [daemon [options]]
Parameters are :- Parameters are :-
<command> - One of 'startup|shutdown|status|check|logrot' or <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 [daemon [options]] - Daemon name and options, required for second group of commands
"); ");
exit( -1 ); exit( -1 );
@ -90,7 +90,11 @@ if( !$command )
print( STDERR "No command given\n" ); print( STDERR "No command given\n" );
Usage(); 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 ); my $daemon = shift( @ARGV );
if( $needs_daemon && !$daemon ) if( $needs_daemon && !$daemon )
{ {