diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-30 13:33:22 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-30 13:33:22 +0000 |
commit | 9f92984a3f92d9b3cc581872ae90e6fc6a9b1e1c (patch) | |
tree | b1f754cabb71b253740de26291121a03dff97e4c /dist.sh | |
parent | e3a8756d4fbad2d4653a32f70af17d4fe7a549f3 (diff) | |
download | rspamd-9f92984a3f92d9b3cc581872ae90e6fc6a9b1e1c.tar.gz rspamd-9f92984a3f92d9b3cc581872ae90e6fc6a9b1e1c.zip |
Use mktemp when available
Diffstat (limited to 'dist.sh')
-rwxr-xr-x | dist.sh | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |