Commit 7b7d18a9 authored by Jérome Perrin's avatar Jérome Perrin

slapos_web_deploy: use mktemp to create temp directory

parent 16752b7f
......@@ -19,10 +19,9 @@ function download_playbook {
if [ ! -f /etc/opt/slapcache.cfg ]; then
slapcache-conf
fi
DFILE="/tmp/tmpplaybook$(basename $0).$$/"
DFILE=$(mktemp -d -t "$(basename "$0")"-XXXXXXXXXXXX)
TFILE="archive.tar.gz"
mkdir -p $DFILE
cd $DFILE
cd "$DFILE" || exit 1
slapcache-download --destination=$TFILE
tar -xzvf $TFILE
rm $TFILE
......
......@@ -4,10 +4,9 @@ if [ ! -f /etc/opt/slapcache.cfg ]; then
fi
sed -i "s/key = slapos-global-key/key = slapos-global-official-vifib-testing-key/g" /etc/opt/slapcache.cfg
DFILE="/tmp/tmpplaybook_unstable$(basename $0).$$/"
DFILE=$(mktemp -d -t tmpplaybook_unstable"$(basename "$0")".XXXXXXXXXXXX)
TFILE="archive.tar.gz"
mkdir -p $DFILE
cd $DFILE
cd "$DFILE" || exit 1
slapcache-download --destination=$TFILE
tar -xzvf $TFILE
rm $TFILE
......@@ -4,10 +4,9 @@ if [ ! -f /etc/opt/slapcache.cfg ]; then
fi
sed -i "s/key = slapos-global-key/key = slapos-global-unstable-key/g" /etc/opt/slapcache.cfg
DFILE="/tmp/tmpplaybook_unstable$(basename $0).$$/"
DFILE=$(mktemp -d -t tmpplaybook_unstable"$(basename "$0")".XXXXXXXXXXXX)
TFILE="archive.tar.gz"
mkdir -p $DFILE
cd $DFILE
cd "$DFILE" || exit 1
slapcache-download --destination=$TFILE
tar -xzvf $TFILE
rm $TFILE
......@@ -4,10 +4,9 @@ if [ ! -f /etc/opt/slapcache.cfg ]; then
fi
sed -i "s/key = slapos-global-key/key = slapos-global-official-vifib-key/g" /etc/opt/slapcache.cfg
DFILE="/tmp/tmpplaybook_unstable$(basename $0).$$/"
DFILE=$(mktemp -d -t tmpplaybook_unstable"$(basename "$0")".XXXXXXXXXXXX)
TFILE="archive.tar.gz"
mkdir -p $DFILE
cd $DFILE
cd "$DFILE" || exit 1
slapcache-download --destination=$TFILE
tar -xzvf $TFILE
rm $TFILE
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment