-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_runner.sh
More file actions
78 lines (67 loc) · 2.04 KB
/
update_runner.sh
File metadata and controls
78 lines (67 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
_UPD=1
# padding handles script being overwritten during updates
# see https://git.ispconfig.org/ispconfig/ispconfig3/issues/4227
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
##################################################
SOURCE=$1
URL=""
if [[ "$SOURCE" == "stable" ]] ; then
URL="https://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz"
elif [[ "$SOURCE" == "nightly" ]] ; then
URL="https://www.ispconfig.org/downloads/ISPConfig-3-nightly.tar.gz"
elif [[ "$SOURCE" == "git-develop" ]] ; then
URL="https://git.ispconfig.org/ispconfig/ispconfig3/-/archive/develop/ispconfig3-develop.tar.gz"
else
echo "Please choose an installation source (stable, nightly, git-develop)"
exit 1
fi
CURDIR=$PWD
cd /tmp
{
if [ -n "${_UPD}" ]
then
{
save_umask=`umask`
umask 0077 \
&& tmpdir=`mktemp -dt "$(basename $0).XXXXXXXXXX"` \
&& test -d "${tmpdir}" \
&& cd "${tmpdir}"
umask $save_umask
} || {
echo 'mktemp failed'
exit 1
}
echo "Downloading ISPConfig update."
wget -q -O ISPConfig-3.tar.gz "${URL}"
if [ -f ISPConfig-3.tar.gz ]
then
echo "Unpacking ISPConfig update."
tar xzf ISPConfig-3.tar.gz --strip-components=1
cd 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."
cd "$CURDIR"
exit 1
fi
fi
cd "$CURDIR"
exit 0
}