Commit 82f6e7b1 authored by Marius Burkard's avatar Marius Burkard
Browse files

- update script rework

parent c89029d7
......@@ -88,25 +88,18 @@ echo "\n".str_repeat('-', 80)."\n";
echo "\n\n>> Update \n\n";
echo "Please choose the update method. For production systems select 'stable'. \nWARNING: The update from GIT is only for development systems and may break your current setup. Do not use the GIT version on servers that host any live websites!\nNote: Update all slave server, before you update master server.\n\n";
$method = simple_query('Select update method', array('stable', 'git-stable', 'git-master'), 'stable');
$method = simple_query('Select update method', array('stable', 'nightly', 'git-develop'), 'stable');
if($method == 'stable') {
$new_version = @file_get_contents('https://www.ispconfig.org/downloads/ispconfig3_version.txt') or die('Unable to retrieve version file.');
$new_version = trim($new_version);
if(version_compare($new_version, ISPC_APP_VERSION, '>')) {
passthru('/usr/local/ispconfig/server/scripts/update_stable.sh');
exit;
} else {
if(version_compare($new_version, ISPC_APP_VERSION, '<=') && !in_array('--force', $argv, true)) {
echo "There are no updates available for ISPConfig ".ISPC_APP_VERSION."\n";
echo "If you are sure you want to update to stable anyway, please use --force parameter\n";
echo "DOWNGRADING MAY CAUSE ISSUES!\n";
exit(1);
}
} elseif ($method == 'git-stable') {
passthru('/usr/local/ispconfig/server/scripts/update_from_dev_stable.sh');
exit;
} else {
passthru('/usr/local/ispconfig/server/scripts/update_from_dev.sh');
exit;
}
?>
passthru('/usr/local/ispconfig/server/scripts/update_runner.sh ' . escapeshellarg($method));
exit;
#!/bin/bash
{
umask 0077 \
&& tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
&& test -d "${tmpdir}" \
&& cd "${tmpdir}"
} || {
echo 'mktemp failed'
exit 1
}
echo "This script is no longer used. Please use ispconfig_update.sh instead." ;
wget -O ispconfig3-dev.tar.gz "https://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=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 "${tmpdir}"
exit 0
exit 1;
#!/bin/bash
{
umask 0077 \
&& tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
&& test -d "${tmpdir}" \
&& cd "${tmpdir}"
} || {
echo 'mktemp failed'
exit 1
}
echo "This script is no longer used. Please use ispconfig_update.sh instead." ;
wget -O ispconfig3-dev.tar.gz "https://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=stable-3.1"
tar xzf ispconfig3-dev.tar.gz
echo -n "Latest git version: "
ls -1d ispconfig3-stable*
cd ispconfig3-stable*/install
php -q \
-d disable_classes= \
-d disable_functions= \
-d open_basedir= \
update.php
cd /tmp
rm -rf "${tmpdir}"
exit 0
exit 1;
#!/bin/bash
_UPD=1
echo "This script is no longer used. Please use ispconfig_update.sh instead." ;
# padding handles script being overwritten during updates
# see https://git.ispconfig.org/ispconfig/ispconfig3/issues/4227
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
{
if [ -n "${_UPD}" ]
then
{
umask 0077 \
&& tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
&& test -d "${tmpdir}" \
&& cd "${tmpdir}"
} || {
echo 'mktemp failed'
exit 1
}
wget https://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
}
exit 1;
Supports Markdown
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