forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathv-add-vesta-softaculous
More file actions
executable file
·124 lines (103 loc) · 3.65 KB
/
v-add-vesta-softaculous
File metadata and controls
executable file
·124 lines (103 loc) · 3.65 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
# info: add vesta softaculous
# options: [TYPE]
#
# The script enables softaculous plugin
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
TYPE=$1
# Includes
source /etc/profile
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
if [ "$TYPE" = 'WEB' ]; then
if [ ! -e "$VESTA/softaculous" ] && [ ! -e "$VESTA/ioncube" ]; then
$BIN/v-schedule-vesta-softaculous
exit
fi
else
cmd="v-add-vesta-softaculous"
check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null)
if [ ! -z "$check_cron" ]; then
eval $check_cron
$BIN/v-delete-cron-job admin $JOB
fi
fi
if [ "$SOFTACULOUS" = 'yes' ]; then
exit
fi
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Cleaning yum cache
if [ -e "/etc/redhat-release" ]; then
yum -q clean all
yum="yum -q -y --noplugins --disablerepo=* --enablerepo=vesta"
else
export DEBIAN_FRONTEND=noninteractive
apt-get update -o Dir::Etc::sourcelist="sources.list.d/vesta.list" \
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" -qq
fi
# Updating php pacakge
if [ -z "$($VESTA/php/bin/php -v|grep 'PHP 5.6')" ]; then
if [ -e "/etc/redhat-release" ]; then
$yum -y update vesta-php
check_result $? "vesta-php package upgrade failed" $E_UPDATE
else
apt-get -y install vesta-php
check_result $? "vesta-php package upgrade failed" $E_UPDATE
fi
fi
# Adding vesta-ioncube package
if [ -e "/etc/redhat-release" ]; then
rpm -q vesta-ioncube >/dev/null 2>&1
if [ $? -ne 0 ]; then
$yum -y install vesta-ioncube >/dev/null 2>&1
check_result $? "vesta-ioncube package installation failed" $E_UPDATE
fi
else
dpkg -l vesta-ioncube |grep ^ii >/dev/null 2>&1
if [ $? -ne 0 ]; then
apt-get -y install vesta-ioncube >/dev/null 2>&1
check_result $? "vesta-ioncube package installation failed" $E_UPDATE
fi
fi
# Adding vesta-softaculous package
if [ -e "/etc/redhat-release" ]; then
rpm -q vesta-softaculous >/dev/null 2>&1
if [ $? -ne 0 ]; then
$yum -y install vesta-softaculous >/dev/null 2>&1
check_result $? "vesta-softaculous package installation failed" $E_UPDATE
fi
else
dpkg -l vesta-softaculous |grep ^ii >/dev/null 2>&1
if [ $? -ne 0 ]; then
apt-get -y install vesta-softaculous >/dev/null 2>&1
check_result $? "vesta-softaculous package installation failed" $E_UPDATE
fi
fi
# Installing softaculous
if [ ! -e "$VESTA/softaculous/vst_installed" ]; then
cd $VESTA/softaculous
wget -q http://c.vestacp.com/3rdparty/softaculous_install.inc
$VESTA/php/bin/php softaculous_install.inc
check_result $? "vesta-softaculous package installation failed" $E_UPDATE
touch $VESTA/softaculous/vst_installed
fi
# Updating SOFTACULOUS value
if [ -z "$(grep SOFTACULOUS $VESTA/conf/vesta.conf)" ]; then
echo "SOFTACULOUS='yes'" >> $VESTA/conf/vesta.conf
else
sed -i "s/SOFTACULOUS.*/SOFTACULOUS='yes'/g" \
$VESTA/conf/vesta.conf
fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$ARGUMENTS"
exit