Skip to content
Snippets Groups Projects
Commit 269b2cef authored by Jesse Norell's avatar Jesse Norell
Browse files

handle bash script overwrites during update. fixes #4227

parent 7d6dfc5f
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
php -q \
-d disable_classes= \
-d disable_functions= \
-d open_basedir= \
/usr/local/ispconfig/server/scripts/ispconfig_update.php
_UPD=1
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
# padding handles script being overwritten during updates
# see https://git.ispconfig.org/ispconfig/ispconfig3/issues/4227
{
if [ -n "${_UPD}" ]
then
exec php -q \
-d disable_classes= \
-d disable_functions= \
-d open_basedir= \
/usr/local/ispconfig/server/scripts/ispconfig_update.php
fi
}
#!/bin/bash
{
{
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 ]
_UPD=1
# padding handles script being overwritten during updates
# see https://git.ispconfig.org/ispconfig/ispconfig3/issues/4227
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
{
if [ -n "${_UPD}" ]
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
cd /tmp
rm -rf "${tmpdir}"
else
echo "Unable to download the update."
exit 1
{
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 ]
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
cd /tmp
rm -rf "${tmpdir}"
else
echo "Unable to download the update."
exit 1
fi
fi
exit 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment