Use CreateTempFile function for temporary files

This commit is contained in:
mboelen 2016-01-11 00:24:00 +01:00
parent 20dd3c50d7
commit d5867762c6
1 changed files with 4 additions and 8 deletions

View File

@ -36,14 +36,10 @@
/usr/local/etc/apache /usr/local/etc/apache2 /usr/local/etc/apache22 \
/usr/pkg/etc/httpd /etc/sysconfig/apache2"
if [ "${OS}" = "AIX" ]; then
RANDOMSTRING1=`echo lynis-$(od -N4 -tu /dev/random | awk 'NR==1 {print $2} {}')`; RANDOMSTRING2=`echo lynis2-$(od -N4 -tu /dev/random | awk 'NR==1 {print $2} {}')`
TMPFILE="/tmp/${RANDOMSTRING1}"; TMPFILE2="/tmp/${RANDOMSTRING2}"
echo "" > ${TMPFILE}; echo "" > ${TMPFILE2}
else
TMPFILE=`mktemp /tmp/lynis.XXXXXXXXXX` || exit 1
TMPFILE2=`mktemp /tmp/lynis2.XXXXXXXXXX` || exit 1
fi
CreateTempFile
TMPFILE="${TEMP_FILE}"
CreateTempFile
TMPFILE2="${TEMP_FILE}"
#
#################################################################################
#