diff --git a/bin/v-add-vesta-softaculous b/bin/v-add-vesta-softaculous new file mode 100755 index 00000000..bde6abfd --- /dev/null +++ b/bin/v-add-vesta-softaculous @@ -0,0 +1,122 @@ +#!/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 + $BIN/v-schedule-vesta-softaculous + exit +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 diff --git a/bin/v-delete-vesta-softaculous b/bin/v-delete-vesta-softaculous new file mode 100755 index 00000000..54cbace1 --- /dev/null +++ b/bin/v-delete-vesta-softaculous @@ -0,0 +1,42 @@ +#!/bin/bash +# info: delete vesta softaculous +# options: NONE +# +# The script disables softaculous plugin + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Includes +source $VESTA/func/main.sh +source $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Verifications # +#----------------------------------------------------------# + +if [ "$SOFTACULOUS" = 'no' ] || [ -z "$SOFTACULOUS" ]; then + exit +fi + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Updating SOFTACULOUS value +sed -i "s/SOFTACULOUS.*/SOFTACULOUS='no'/g" \ + $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +# Logging +log_event "$OK" "$ARGUMENTS" + +exit diff --git a/bin/v-list-sys-config b/bin/v-list-sys-config index c0ed3851..879c3ab3 100755 --- a/bin/v-list-sys-config +++ b/bin/v-list-sys-config @@ -50,7 +50,8 @@ json_list() { "BACKUP": "'$BACKUP'", "MAIL_URL": "'$MAIL_URL'", "DB_PMA_URL": "'$DB_PMA_URL'", - "DB_PGA_URL": "'$DB_PGA_URL'" + "DB_PGA_URL": "'$DB_PGA_URL'", + "SOFTACULOUS": "'$SOFTACULOUS'" } }' } @@ -131,6 +132,9 @@ shell_list() { if [ ! -z "$SFTPJAIL_KEY" ]; then echo "SFTP Chroot: $SFTPJAIL_KEY" fi + if [ ! -z "$SOFTACULOUS" ]; then + echo "Softaculous: $SOFTACULOUS" + fi if [ ! -z "$LANGUAGE" ] && [ "$LANGUAGE" != 'en' ]; then echo "Language: $LANGUAGE" fi @@ -171,7 +175,7 @@ csv_list() { echo -n "'$CRON_SYSTEM','$DISK_QUOTA','$FIREWALL_SYSTEM'," echo -n "'$FIREWALL_EXTENSION','$FILEMANAGER_KEY','$SFTPJAIL_KEY'," echo -n "'$REPOSITORY','$VERSION','$LANGUAGE','$BACKUP_GZIP','$BACKUP'," - echo -n "'$MAIL_URL','$DB_PMA_URL','$DB_PGA_URL'" + echo -n "'$MAIL_URL','$DB_PMA_URL','$DB_PGA_URL', '$SOFTACULOUS'" echo } diff --git a/bin/v-schedule-vesta-softaculous b/bin/v-schedule-vesta-softaculous new file mode 100755 index 00000000..9474f50f --- /dev/null +++ b/bin/v-schedule-vesta-softaculous @@ -0,0 +1,46 @@ +#!/bin/bash +# info: adding cronjob for vesta-softaculous installation +# options: NONE +# +# The function adds cronjob for letsencrypt ssl certificate installation + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Includes +source $VESTA/func/main.sh +source $VESTA/func/domain.sh +source $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Verifications # +#----------------------------------------------------------# + +is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM' + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + + +# Adding cronjob for vesta-softaculous +cmd="sudo /usr/local/vesta/bin/v-add-vesta-softaculous" +check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null) +if [ -z "$check_cron" ] && [ ! -z "$CRON_SYSTEM" ]; then + $BIN/v-add-cron-job admin '*/1' '*' '*' '*' '*' "$cmd" +fi + + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +# Logging +log_event "$OK" "$ARGUMENTS" + +exit diff --git a/web/edit/server/index.php b/web/edit/server/index.php index 960b9e50..a505e214 100644 --- a/web/edit/server/index.php +++ b/web/edit/server/index.php @@ -463,7 +463,7 @@ if (!empty($_POST['save'])) { // activating softaculous if (empty($_SESSION['error_msg'])) { if($_SESSION['SOFTACULOUS'] != $_POST['v_softaculous'] && $_POST['v_softaculous'] == 'yes'){ - exec (VESTA_CMD."v-add-sys-softaculous", $output, $return_var); + exec (VESTA_CMD."v-add-vesta-softaculous WEB", $output, $return_var); check_return_code($return_var,$output); unset($output); if (empty($_SESSION['error_msg'])) { @@ -476,7 +476,7 @@ if (!empty($_POST['save'])) { // disable softaculous if (empty($_SESSION['error_msg'])) { if($_SESSION['SOFTACULOUS'] != $_POST['v_softaculous'] && $_POST['v_softaculous'] == 'no'){ - exec (VESTA_CMD."v-delete-sys-softaculous", $output, $return_var); + exec (VESTA_CMD."v-delete-vesta-softaculous", $output, $return_var); check_return_code($return_var,$output); unset($output); if (empty($_SESSION['error_msg'])) { diff --git a/web/templates/admin/edit_server.html b/web/templates/admin/edit_server.html index 904e42ef..5ce00866 100644 --- a/web/templates/admin/edit_server.html +++ b/web/templates/admin/edit_server.html @@ -280,67 +280,6 @@

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
- "> -
-
-
- "> -
-
-
- "> -
-
-
- "> -
- - @@ -925,7 +864,7 @@

style="display:none" > -
Web Application Installations Made Easy
+
* plugin installation will run in background
Softaculous is a great Auto Installer having 426 great scripts, 1115 PHP Classes and we are still adding more. Softaculous is ideal for Web Hosting companies and it could give a significant boost to your sales. These scripts cover most of the