Skip to content

Commit 0803b0c

Browse files
author
Marius Burkard
committed
Merge branch 'develop' into stable-old
2 parents 82f6e7b + 54d11f0 commit 0803b0c

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

server/scripts/update_runner.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/bash
2+
3+
_UPD=1
4+
5+
# padding handles script being overwritten during updates
6+
# see https://git.ispconfig.org/ispconfig/ispconfig3/issues/4227
7+
8+
##################################################
9+
##################################################
10+
##################################################
11+
##################################################
12+
##################################################
13+
##################################################
14+
##################################################
15+
##################################################
16+
##################################################
17+
##################################################
18+
##################################################
19+
##################################################
20+
21+
SOURCE=$1
22+
URL=""
23+
24+
if [[ "$SOURCE" == "stable" ]] ; then
25+
URL="https://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz"
26+
elif [[ "$SOURCE" == "nightly" ]] ; then
27+
URL="https://www.ispconfig.org/downloads/ISPConfig-3-nightly.tar.gz"
28+
elif [[ "$SOURCE" == "git-develop" ]] ; then
29+
URL="https://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=develop"
30+
else
31+
echo "Please choose an installation source (stable, nightly, git-develop)"
32+
exit 1
33+
fi
34+
35+
CURDIR=$PWD
36+
37+
cd /tmp
38+
39+
{
40+
if [ -n "${_UPD}" ]
41+
then
42+
{
43+
umask 0077 \
44+
&& tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
45+
&& test -d "${tmpdir}" \
46+
&& cd "${tmpdir}"
47+
} || {
48+
echo 'mktemp failed'
49+
exit 1
50+
}
51+
52+
wget -O ISPConfig-3.tar.gz "${URL}"
53+
if [ -f ISPConfig-3.tar.gz ]
54+
then
55+
tar xvzf ISPConfig-3.tar.gz --strip-components=1
56+
cd install/
57+
php -q \
58+
-d disable_classes= \
59+
-d disable_functions= \
60+
-d open_basedir= \
61+
update.php
62+
cd /tmp
63+
rm -rf "${tmpdir}"
64+
else
65+
echo "Unable to download the update."
66+
cd "$CURDIR"
67+
exit 1
68+
fi
69+
70+
fi
71+
72+
cd "$CURDIR"
73+
exit 0
74+
}

0 commit comments

Comments
 (0)