#! /bin/sh
-# Copyright (c) 2008, 2009, 2010 Nicira Networks, Inc.
+# Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
-f, --force Continue even if file or directory already exists
-l, --log=FILE Log openssl output to FILE (default: ovs-log.log)
-h, --help Print this usage message.
+ -V, --version Display version information.
EOF
exit 0
;;
+ -V|--version)
+ echo "ovs-pki (Open vSwitch) @VERSION@"
+ exit 0
+ ;;
--di*=*)
pkidir=$optarg
;;
fi
case $log in
/*) ;;
- *) $log="$PWD/$log" ;;
+ *) log=`pwd`/$log ;;
esac
logdir=$(dirname "$log")
# Create the CAs.
for ca in controllerca switchca; do
echo "Creating $ca..." >&2
- oldpwd=$PWD
+ oldpwd=`pwd`
mkdir -p $ca
cd $ca
file=$1
name=${1-$2}
date=$(date -r $file)
- if grep -q -e '-BEGIN CERTIFICATE-' "$file"; then
+ if grep -e '-BEGIN CERTIFICATE-' "$file" > /dev/null; then
fingerprint=$(openssl x509 -noout -in "$file" -fingerprint |
sed 's/SHA1 Fingerprint=//' | tr -d ':')
else