[ssl_mgmt] Alert user if no overwrite occur

This commit is contained in:
Thomas Preud'homme 2014-03-09 18:25:20 +08:00
parent 2674b4341d
commit c76bf20637
1 changed files with 12 additions and 0 deletions

View File

@ -220,9 +220,21 @@ generate_cert ()
return 1
fi
getfacl "$keyPath" | setfacl --set-file=- newkeys/$keyFile
if [ ! -f "private/$keyFile" ]
then
echo -n "Error! No file named $keyFile in directory" >&2
echo " $(readlink -f private):" >&2
echo "there might be a problem" >&2
fi
mv newkeys/$keyFile private
openssl ca -batch -out newcerts/$certFile -config $confFile -passin file:/root/passwords/root_ca -infiles csr/$reqFile
getfacl "$certPath" | setfacl --set-file=- newcerts/$certFile
if [ ! -f "certs/$certFile" ]
then
echo "No file named $certFile in directory" >&2
echo " $(readlink -f certs):" >&2
echo "there might be a problem" >&2
fi
mv newcerts/$certFile certs
cat private/$keyFile certs/$certFile > private/$keycertFile
return 0