ovs-pki: Consistently write error messages to stderr.
authorBen Pfaff <blp@nicira.com>
Fri, 6 Aug 2010 17:22:29 +0000 (10:22 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 6 Aug 2010 20:31:56 +0000 (13:31 -0700)
utilities/ovs-pki.in

index 5c8c4bb..b91d061 100755 (executable)
@@ -161,11 +161,11 @@ if test -z "$command"; then
     exit 1
 fi
 if test "$keytype" != rsa && test "$keytype" != dsa; then
-    echo "$0: argument to -k or --key must be rsa or dsa"
+    echo "$0: argument to -k or --key must be rsa or dsa" >&2
     exit 1
 fi
 if test "$bits" -lt 1024; then
-    echo "$0: argument to -B or --bits must be at least 1024"
+    echo "$0: argument to -B or --bits must be at least 1024" >&2
     exit 1
 fi
 if test -z "$dsaparam"; then
@@ -316,7 +316,7 @@ resolve_prefix() {
         ????*)
             ;;
         *)
-            echo "Prefix $arg1 is too short (less than 4 hex digits)"
+            echo "Prefix $arg1 is too short (less than 4 hex digits)" >&2
             exit 0
             ;;
     esac
@@ -324,13 +324,13 @@ resolve_prefix() {
     fingerprint=$(cd "$pkidir/${type}ca/incoming" && echo "$1"*-req.pem | sed 's/-req\.pem$//')
     case $fingerprint in
         "${1}*")
-            echo "No certificate requests matching $1"
+            echo "No certificate requests matching $1" >&2
             exit 1
             ;;
         *" "*)
-            echo "$1 matches more than one certificate request:"
+            echo "$1 matches more than one certificate request:" >&2
             echo $fingerprint | sed 's/ /\
-/g'
+/g' >&2
             exit 1
             ;;
         *)