error hardening

This commit is contained in:
Roman Hoellen 2018-09-13 11:37:33 +02:00
parent f2d3880dd9
commit bb256fae9d

View File

@ -131,7 +131,13 @@ do
continue continue
fi fi
if [ -s "$arg/tmp.pem" ]; then
mv -f "$arg/tmp.pem" "$arg/$NAME.pem" mv -f "$arg/tmp.pem" "$arg/$NAME.pem"
else
echo "New certificate for \"$NAME\" doesn't exists or is empty"
rm -rf "$arg/tmp.pem"
continue
fi
echo "Certificate for \"$NAME\" successfully created!" echo "Certificate for \"$NAME\" successfully created!"
counter=$((counter+1)) counter=$((counter+1))