Skip to content

Commit 66768ac

Browse files
committed
Added a new update script.
1 parent 9b30b0b commit 66768ac

File tree

8 files changed

+134
-35
lines changed

8 files changed

+134
-35
lines changed

docs/INSTALL_OPENSUSE_11_1.txt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -201,27 +201,4 @@ Install a webbased Email Client
201201

202202
yast2 -i squirrelmail
203203

204-
----------------------------------------------------------------------------------------------------------
205204

206-
Hints:
207-
208-
debian 4.0 under openvz:
209-
210-
VPSID=101
211-
for CAP in CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE
212-
do
213-
vzctl set $VPSID --capability ${CAP}:on --save
214-
done
215-
216-
----------------------------------------------------------------------------------------------------------
217-
218-
Installing Jailkit:
219-
220-
cd /tmp
221-
wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz
222-
tar xvfz jailkit-2.5.tar.gz
223-
cd jailkit-2.5
224-
./configure
225-
make
226-
make install
227-
rm -rf jailkit-2.5*

install/dist/lib/fedora.lib.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,10 +735,16 @@ public function install_ispconfig()
735735
//exec('chmod +r /var/log/clamav/clamav.log');
736736
//exec('chmod +r /var/log/clamav/freshclam.log');
737737

738-
//* Install the SVN update script
739-
exec('cp ../helper_scripts/update_from_svn.sh /usr/local/bin/ispconfig_update_from_svn.sh');
740-
exec('chown root /usr/local/bin/ispconfig_update_from_svn.sh');
741-
exec('chmod 700 /usr/local/bin/ispconfig_update_from_svn.sh');
738+
//* Install the update script
739+
if(is_file('/usr/local/bin/ispconfig_update_from_svn.sh')) unlink('/usr/local/bin/ispconfig_update_from_svn.sh');
740+
exec('chown root /usr/local/ispconfig/server/scripts/update_from_svn.sh');
741+
exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_svn.sh');
742+
exec('chown root /usr/local/ispconfig/server/scripts/update_from_tgz.sh');
743+
exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_tgz.sh');
744+
exec('chown root /usr/local/ispconfig/server/scripts/ispconfig_update.sh');
745+
exec('chmod 700 /usr/local/ispconfig/server/scripts/ispconfig_update.sh');
746+
exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update_from_svn.sh');
747+
exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update.sh');
742748

743749
// set the fast cgi starter script to executable
744750
// exec('chmod 755 '.$install_dir.'/interface/bin/php-fcgi');

install/dist/lib/opensuse.lib.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -753,10 +753,16 @@ public function install_ispconfig()
753753
//exec('chmod +r /var/log/clamav/clamav.log');
754754
//exec('chmod +r /var/log/clamav/freshclam.log');
755755

756-
//* Install the SVN update script
757-
exec('cp ../helper_scripts/update_from_svn.sh /usr/local/bin/ispconfig_update_from_svn.sh');
758-
exec('chown root /usr/local/bin/ispconfig_update_from_svn.sh');
759-
exec('chmod 700 /usr/local/bin/ispconfig_update_from_svn.sh');
756+
//* Install the update script
757+
if(is_file('/usr/local/bin/ispconfig_update_from_svn.sh')) unlink('/usr/local/bin/ispconfig_update_from_svn.sh');
758+
exec('chown root /usr/local/ispconfig/server/scripts/update_from_svn.sh');
759+
exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_svn.sh');
760+
exec('chown root /usr/local/ispconfig/server/scripts/update_from_tgz.sh');
761+
exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_tgz.sh');
762+
exec('chown root /usr/local/ispconfig/server/scripts/ispconfig_update.sh');
763+
exec('chmod 700 /usr/local/ispconfig/server/scripts/ispconfig_update.sh');
764+
exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update_from_svn.sh');
765+
exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update.sh');
760766

761767
//set the fast cgi starter script to executable
762768
//exec('chmod 755 '.$install_dir.'/interface/bin/php-fcgi');

install/lib/installer_base.lib.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,10 +1026,16 @@ public function install_ispconfig()
10261026

10271027
}
10281028

1029-
//* Install the SVN update script
1030-
exec('cp ../helper_scripts/update_from_svn.sh /usr/local/bin/ispconfig_update_from_svn.sh');
1031-
exec('chown root /usr/local/bin/ispconfig_update_from_svn.sh');
1032-
exec('chmod 700 /usr/local/bin/ispconfig_update_from_svn.sh');
1029+
//* Install the update script
1030+
if(is_file('/usr/local/bin/ispconfig_update_from_svn.sh')) unlink('/usr/local/bin/ispconfig_update_from_svn.sh');
1031+
exec('chown root /usr/local/ispconfig/server/scripts/update_from_svn.sh');
1032+
exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_svn.sh');
1033+
exec('chown root /usr/local/ispconfig/server/scripts/update_from_tgz.sh');
1034+
exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_tgz.sh');
1035+
exec('chown root /usr/local/ispconfig/server/scripts/ispconfig_update.sh');
1036+
exec('chmod 700 /usr/local/ispconfig/server/scripts/ispconfig_update.sh');
1037+
exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update_from_svn.sh');
1038+
exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update.sh');
10331039

10341040
//* Make the logs readable for the ispconfig user
10351041
if(@is_file('/var/log/mail.log')) exec('chmod +r /var/log/mail.log');
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2009, Till Brehm, projektfarm Gmbh
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
function simple_query($query, $answers, $default)
32+
{
33+
$finished = false;
34+
do {
35+
$answers_str = implode(',', $answers);
36+
swrite($this->lng($query).' ('.$answers_str.') ['.$default.']: ');
37+
$input = sread();
38+
39+
//* Stop the installation
40+
if($input == 'quit') {
41+
swriteln($this->lng("Installation terminated by user.\n"));
42+
die();
43+
}
44+
45+
//* Select the default
46+
if($input == '') {
47+
$answer = $default;
48+
$finished = true;
49+
}
50+
51+
//* Set answer id valid
52+
if(in_array($input, $answers)) {
53+
$answer = $input;
54+
$finished = true;
55+
}
56+
57+
} while ($finished == false);
58+
swriteln();
59+
return $answer;
60+
}
61+
62+
require_once('/usr/local/ispconfig/server/lib/config.inc.php');
63+
64+
65+
echo "\n\n".str_repeat('-',80)."\n";
66+
echo " _____ ___________ _____ __ _
67+
|_ _/ ___| ___ \ / __ \ / _(_)
68+
| | \ `--.| |_/ / | / \/ ___ _ __ | |_ _ __ _
69+
| | `--. \ __/ | | / _ \| '_ \| _| |/ _` |
70+
_| |_/\__/ / | | \__/\ (_) | | | | | | | (_| |
71+
\___/\____/\_| \____/\___/|_| |_|_| |_|\__, |
72+
__/ |
73+
|___/ ";
74+
echo "\n".str_repeat('-',80)."\n";
75+
echo "\n\n>> Update \n\n";
76+
echo "Please choose the update method. For production systems select 'stable'. \nThe update from svn is only for development systems and may break your current setup.\n\n";
77+
78+
$method = $inst->simple_query('Select update method', array('stable','svn'), 'stable');
79+
80+
if($method == 'stable') {
81+
$new_version = file_get_contents('http://www.ispconfig.org/downloads/ispconfig3_version.txt') or die('Unable to retrieve version file.');
82+
$new_version = trim($new_version);
83+
if($new_version != ISPC_APP_VERSION) {
84+
exec('/usr/local/ispconfig/server/scripts/update_from_tgz.sh')
85+
} else {
86+
echo "There are no updates available.\n";
87+
}
88+
} else {
89+
exec('/usr/local/ispconfig/server/scripts/update_from_svn.sh');
90+
}
91+
92+
93+
94+
?>

server/scripts/ispconfig_update.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
php -q /usr/local/ispconfig/server/scripts/ispconfig_update.php

server/scripts/update_from_tgz.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
cd /tmp
4+
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
5+
cd ispconfig3_install/install/
6+
php -q update.php
7+
rm -rf /tmp/ispconfig3_install/install

0 commit comments

Comments
 (0)