Commit 0b76df43 authored by Jesse Norell's avatar Jesse Norell
Browse files

use mktemp in update scripts to avoid race conditions

parent 982cb630
#!/bin/bash
cd /tmp
rm -f ispconfig3-dev.tar.gz
{
umask 0077 \
&& tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
&& test -d "${tmpdir}" \
&& cd "${tmpdir}"
} || {
echo 'mktemp failed'
exit 1
}
wget -O ispconfig3-dev.tar.gz "http://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=master"
rm -rf ispconfig3-master*
tar xzf ispconfig3-dev.tar.gz
echo -n "Latest git version: "
ls -1d ispconfig3-master*
cd ispconfig3-master*/install
php -q \
-d disable_classes= \
-d disable_functions= \
-d open_basedir= \
update.php
cd /tmp
rm -rf /tmp/ispconfig3-master* /tmp/ispconfig3-dev.tar.gz
rm -rf "${tmpdir}"
exit 0
#!/bin/bash
cd /tmp
if [ -f ISPConfig-3-stable.tar.gz ]
then
rm -f ISPConfig-3-stable.tar.gz
fi
{
umask 0077 \
&& tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
&& test -d "${tmpdir}" \
&& cd "${tmpdir}"
} || {
echo 'mktemp failed'
exit 1
}
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
if [ -f ISPConfig-3-stable.tar.gz ]
......@@ -13,14 +16,15 @@ then
tar xvfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install/
php -q \
-d disable_classes= \
-d disable_functions= \
-d open_basedir= \
update.php
rm -rf /tmp/ispconfig3_install/install
rm -f ISPConfig-3-stable.tar.gz
-d disable_classes= \
-d disable_functions= \
-d open_basedir= \
update.php
cd /tmp
rm -rf "${tmpdir}"
else
echo "Unable to download the update."
exit 1
fi
exit 0
\ No newline at end of file
exit 0
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