Created
December 16, 2012 17:18
-
-
Save yinyin/4309765 to your computer and use it in GitHub Desktop.
argument parsing of daemonize.pl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if($opt =~ /^--pid=(.+)$/) | |
{ $PID = $1; $PID =~ s/\s+$//; } | |
elsif($opt =~/^--(working-dir|wd)=(.+)$/) | |
{ $WORKDIR = $2; $WORKDIR =~ s/\s+$//; } | |
elsif($opt =~/^--(log|terminal-log)=(.+)$/) | |
{ $TRMLOG = $2; $TRMLOG =~ s/\s+$//; } | |
elsif($opt =~/^--send-int-before-term=([0-9]+)$/) | |
{ $SEND_INT_BEFORE_TERM = int($1); } | |
elsif( ($opt eq '-v') or ($opt eq '--verbose') ) | |
{ $VERBOSE = 1; } | |
elsif($opt eq '--') | |
{ $readopt = 0; } | |
elsif($opt eq 'start') | |
{ $operation_mode = 'start'; } | |
elsif($opt eq 'stop') | |
{ $operation_mode = 'stop'; } | |
elsif( ($opt eq 'check') or ($opt eq 'status') ) | |
{ $operation_mode = 'check'; } | |
elsif($opt eq 'startstart') | |
{ $operation_mode = 'startstart'; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment