Make file name generation to work with both new and old versions of OpenSSL.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Pawel Jakub Dawidek 2013-03-15 00:10:38 +00:00
parent f1f8908049
commit 374b056ce8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=248304

View File

@ -89,7 +89,7 @@ todo()
namegen()
{
echo "pjdfstest_`dd if=/dev/urandom bs=1k count=1 2>/dev/null | openssl md5`"
echo "pjdfstest_`dd if=/dev/urandom bs=1k count=1 2>/dev/null | openssl md5 | awk '{print $NF}'`"
}
namegen_len()
@ -98,7 +98,7 @@ namegen_len()
name=""
while :; do
namepart="`dd if=/dev/urandom bs=64 count=1 2>/dev/null | openssl md5`"
namepart="`dd if=/dev/urandom bs=64 count=1 2>/dev/null | openssl md5 | awk '{print $NF}'`"
name="${name}${namepart}"
curlen=`printf "%s" "${name}" | wc -c`
[ ${curlen} -lt ${len} ] || break