-#! /bin/sh -e
+#! /bin/sh
+
+set -e
pkidir='@PKIDIR@'
command=
prev=
force=no
batch=no
-log=ofp-pki.log
+log='@LOGDIR@/ofp-pki.log'
keytype=rsa
bits=2048
for option; do
if test -z "$dsaparam"; then
dsaparam=$pkidir/dsaparam.pem
fi
+case $log in
+ /*) ;;
+ *) $log="$PWD/$log" ;;
+esac
if test "$command" = "init"; then
if test -e "$pkidir" && test "$force" != "yes"; then
fi
}
-case $log in
- /*)
- exec 3>>$log || true
- ;;
- *)
- exec 3>>$pkidir/$log || true
- ;;
-esac
-
+exec 3>>$log || true
if test "$command" = req; then
one_arg
must_not_exist "$arg1-cert.pem"
openssl x509 -in "$arg1-req.pem" -out "$arg1-cert.pem" \
- -signkey "$arg1-privkey.pem" -req -text
+ -signkey "$arg1-privkey.pem" -req -text 2>&3
elif test "$command" = ls; then
check_type "$arg2"