Commit 5a6cc2c0 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_web_deploy: use mktemp to create temp directory

See merge request nexedi/slapos.core!418
parents 2a273d72 7b7d18a9
...@@ -19,10 +19,9 @@ function download_playbook { ...@@ -19,10 +19,9 @@ function download_playbook {
if [ ! -f /etc/opt/slapcache.cfg ]; then if [ ! -f /etc/opt/slapcache.cfg ]; then
slapcache-conf slapcache-conf
fi fi
DFILE="/tmp/tmpplaybook$(basename $0).$$/" DFILE=$(mktemp -d -t "$(basename "$0")"-XXXXXXXXXXXX)
TFILE="archive.tar.gz" TFILE="archive.tar.gz"
mkdir -p $DFILE cd "$DFILE" || exit 1
cd $DFILE
slapcache-download --destination=$TFILE slapcache-download --destination=$TFILE
tar -xzvf $TFILE tar -xzvf $TFILE
rm $TFILE rm $TFILE
......
...@@ -4,10 +4,9 @@ if [ ! -f /etc/opt/slapcache.cfg ]; then ...@@ -4,10 +4,9 @@ if [ ! -f /etc/opt/slapcache.cfg ]; then
fi fi
sed -i "s/key = slapos-global-key/key = slapos-global-official-vifib-testing-key/g" /etc/opt/slapcache.cfg 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" TFILE="archive.tar.gz"
mkdir -p $DFILE cd "$DFILE" || exit 1
cd $DFILE
slapcache-download --destination=$TFILE slapcache-download --destination=$TFILE
tar -xzvf $TFILE tar -xzvf $TFILE
rm $TFILE rm $TFILE
...@@ -4,10 +4,9 @@ if [ ! -f /etc/opt/slapcache.cfg ]; then ...@@ -4,10 +4,9 @@ if [ ! -f /etc/opt/slapcache.cfg ]; then
fi fi
sed -i "s/key = slapos-global-key/key = slapos-global-unstable-key/g" /etc/opt/slapcache.cfg 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" TFILE="archive.tar.gz"
mkdir -p $DFILE cd "$DFILE" || exit 1
cd $DFILE
slapcache-download --destination=$TFILE slapcache-download --destination=$TFILE
tar -xzvf $TFILE tar -xzvf $TFILE
rm $TFILE rm $TFILE
...@@ -4,10 +4,9 @@ if [ ! -f /etc/opt/slapcache.cfg ]; then ...@@ -4,10 +4,9 @@ if [ ! -f /etc/opt/slapcache.cfg ]; then
fi fi
sed -i "s/key = slapos-global-key/key = slapos-global-official-vifib-key/g" /etc/opt/slapcache.cfg 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" TFILE="archive.tar.gz"
mkdir -p $DFILE cd "$DFILE" || exit 1
cd $DFILE
slapcache-download --destination=$TFILE slapcache-download --destination=$TFILE
tar -xzvf $TFILE tar -xzvf $TFILE
rm $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