<p dir="ltr">I would use a shell case statement. It should be much cleaner.</p>
<div class="gmail_quote">On May 14, 2014 3:45 PM, "Gurucharan Shetty" <<a href="mailto:shettyg@nicira.com">shettyg@nicira.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How about making the following assumption?<br>
<br>
diff --git a/utilities/<a href="http://ovs-pki.in" target="_blank">ovs-pki.in</a> b/utilities/<a href="http://ovs-pki.in" target="_blank">ovs-pki.in</a><br>
index 7f56b4e..417fdf4 100755<br>
--- a/utilities/<a href="http://ovs-pki.in" target="_blank">ovs-pki.in</a><br>
+++ b/utilities/<a href="http://ovs-pki.in" target="_blank">ovs-pki.in</a><br>
@@ -461,7 +461,12 @@ sign_request() {<br>
must_not_exist "$2"<br>
pkidir_must_exist<br>
<br>
- request_file="`pwd`/$1"<br>
+ if [ "`echo $1 | cut -c1`" = "/" ]; then<br>
+ request_file="$1"<br>
+ else<br>
+ request_file="`pwd`/$1"<br>
+ fi<br>
+<br>
(cd "$pkidir/${type}ca" &&<br>
openssl ca -config ca.cnf -batch -in "$request_file") \<br>
> "$2.tmp$$" 2>&3<br>
<br>
On Wed, May 14, 2014 at 12:58 PM, Ben Pfaff <<a href="mailto:blp@nicira.com">blp@nicira.com</a>> wrote:<br>
> On May 14, 2014 11:35 AM, "Gurucharan Shetty" <<a href="mailto:shettyg@nicira.com">shettyg@nicira.com</a>> wrote:<br>
>><br>
>> On Wed, May 14, 2014 at 11:18 AM, Ben Pfaff <<a href="mailto:blp@nicira.com">blp@nicira.com</a>> wrote:<br>
>> > On Tue, May 13, 2014 at 09:03:18AM -0700, Gurucharan Shetty wrote:<br>
>> >> This lets us generate certs for unit tests on Windows<br>
>> >><br>
>> >> Signed-off-by: Gurucharan Shetty <<a href="mailto:gshetty@nicira.com">gshetty@nicira.com</a>><br>
>> ><br>
>> > This will fail if $1 is absolute (if it begins with /):<br>
>> >> + request_file="`pwd`/$1"<br>
>> Reading the man page gave me an impression that 'name' is just a<br>
>> prefix. I guess not. I will fix it in v2.<br>
><br>
> I think that it would most commonly be just a simple prefix, but i can<br>
> imagine a script calling ovs-pki with a fully qualified name as that prefix.<br>
> Since (I guess) this worked before, I'd like it to continue working.<br>
><br>
> Thanks,<br>
><br>
> Ben.<br>
</blockquote></div>