aboutsummaryrefslogtreecommitdiffstats
path: root/dist.sh
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-30 13:33:22 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-30 13:33:22 +0000
commit9f92984a3f92d9b3cc581872ae90e6fc6a9b1e1c (patch)
treeb1f754cabb71b253740de26291121a03dff97e4c /dist.sh
parente3a8756d4fbad2d4653a32f70af17d4fe7a549f3 (diff)
downloadrspamd-9f92984a3f92d9b3cc581872ae90e6fc6a9b1e1c.tar.gz
rspamd-9f92984a3f92d9b3cc581872ae90e6fc6a9b1e1c.zip
Use mktemp when available
Diffstat (limited to 'dist.sh')
-rwxr-xr-xdist.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/dist.sh b/dist.sh
index e2ecd8e19..6e10cae2f 100755
--- a/dist.sh
+++ b/dist.sh
@@ -12,7 +12,13 @@ PREFIX=`basename $FNAME | sed -e 's/\.tar.*$//'`
OUT=""
while true ; do
- OUT="/tmp/files-`strings -7 /dev/urandom | head -1 | sed -e 's/[^[:alnum:]]//g'`"
+ _mktemp=`which mktemp`
+ if [ F"$_mktemp" != "F" ] ; then
+ OUT=`$_mktemp /tmp/files-XXXXXXXX`
+ break
+ else
+ OUT="/tmp/files-`strings -7 /dev/urandom | head -1 | sed -e 's/[^[:alnum:]]//g'`"
+ fi
if [ ! -f "$OUT" ] ; then break ; fi
done