Raphael Schneeberger 7 лет назад
Родитель
Сommit
67e06374f2

+ 0 - 133
bin/v-add-vesta-softaculous

@@ -1,133 +0,0 @@
-#!/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 [ -d "/etc/sysconfig" ]; 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 [ -d "/etc/sysconfig" ]; 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 [ -d "/etc/sysconfig" ]; 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 [ -d "/etc/sysconfig" ]; 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
-    mkdir -p /var/softaculous
-    chown -R admin:admin /var/softaculous
-    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
-
-# Enabling symlink
-if [ -e "$VESTA/disabled_plugins/softaculous" ]; then
-    if [ ! -e "$VESTA/web/softaculous" ]; then
-        mv $VESTA/disabled_plugins/softaculous $VESTA/web/softaculous
-    fi
-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

+ 0 - 61
bin/v-delete-cron-vesta-autoupdate

@@ -1,61 +0,0 @@
-#!/bin/bash
-# info: delete vesta autoupdate cron job
-# options: NONE
-#
-# The function deletes vesta autoupdate cron job.
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-user=admin
-
-# Includes
-source $VESTA/func/main.sh
-source $VESTA/conf/vesta.conf
-
-
-#----------------------------------------------------------#
-#                    Verifications                         #
-#----------------------------------------------------------#
-
-is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
-check_cron=$(grep 'v-update-sys-vesta-all' $USER_DATA/cron.conf)
-if [ -z "$check_cron" ]; then
-    exit
-fi
-
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-
-# Deleting job
-job=$(echo $check_cron|tr ' ' "\n"|grep JOB|cut -f 2 -d "'")
-sed -i "/JOB='$job' /d" $USER_DATA/cron.conf
-
-# Sorting jobs by id
-sort_cron_jobs
-
-# Sync system cron with user
-sync_cron_jobs
-
-
-#----------------------------------------------------------#
-#                       Vesta                              #
-#----------------------------------------------------------#
-
-# Decreasing cron value
-decrease_user_value "$user" '$U_CRON_JOBS'
-
-# Restarting crond
-$BIN/v-restart-cron
-check_result $? "Cron restart failed" >/dev/null
-
-# Logging
-log_event "$OK" "$ARGUMENTS"
-
-exit

+ 0 - 48
bin/v-delete-vesta-softaculous

@@ -1,48 +0,0 @@
-#!/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                             #
-#----------------------------------------------------------#
-
-# Deleting symlink
-if [ -e "$VESTA/web/softaculous" ]; then
-    mkdir -p $VESTA/disabled_plugins
-    mv $VESTA/web/softaculous $VESTA/disabled_plugins
-fi
-
-# Updating SOFTACULOUS value
-sed -i "s/SOFTACULOUS.*/SOFTACULOUS='no'/g" \
-        $VESTA/conf/vesta.conf
-
-
-#----------------------------------------------------------#
-#                       Vesta                              #
-#----------------------------------------------------------#
-
-# Logging
-log_event "$OK" "$ARGUMENTS"
-
-exit

+ 0 - 81
bin/v-list-sys-vesta-autoupdate

@@ -1,81 +0,0 @@
-#!/bin/bash
-# info: list vesta autoupdate settings
-# options: [FORMAT]
-#
-# The function for obtaining autoupdate setings.
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-user='admin'
-format=${1-shell}
-
-# Includes
-source $VESTA/func/main.sh
-
-# JSON list function
-json_list() {
-    echo '['
-    if [ -z "$check_cron" ]; then
-        echo -e  "\t\"Disabled\","
-    else
-        echo -e  "\t\"Enabled\""
-    fi
-    echo "]"
-}
-
-# SHELL list function
-shell_list() {
-    echo -n "AUTOUPDATE:     "
-    if [ -z "$check_cron" ]; then
-        echo "Disabled"
-    else
-        echo "Enabled"
-    fi
-}
-
-# PLAIN list function
-plain_list() {
-    if [ -z "$check_cron" ]; then
-        echo "Disabled"
-    else
-        echo "Enabled"
-    fi
-}
-
-# CSV list function
-csv_list() {
-    echo "AUTOUPDATE"
-    if [ -z "$check_cron" ]; then
-        echo "Disabled"
-    else
-        echo "Enabled"
-    fi
-}
-
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-# Check cron tab
-check_cron=$(grep 'v-update-sys-vesta-all' $USER_DATA/cron.conf)
-
-# Listing data
-case $format in
-    json)   json_list ;;
-    plain)  plain_list ;;
-    csv)    csv_list ;;
-    shell)  shell_list;;
-esac
-
-
-
-#----------------------------------------------------------#
-#                       Vesta                              #
-#----------------------------------------------------------#
-
-exit

+ 0 - 181
bin/v-list-sys-vesta-updates

@@ -1,181 +0,0 @@
-#!/bin/bash
-# info: list system updates
-# options: [FORMAT]
-#
-# The function checks available updates for vesta packages.
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-format=${1-shell}
-
-# Includes
-source $VESTA/func/main.sh
-source $VESTA/conf/vesta.conf
-fields="\$NAME \$VERSION \$RELEASE \$ARCH \$UPDATED \$DESCR \$TIME \$DATE"
-
-# JSON list function
-json_list() {
-    IFS=$'\n'
-    i=1
-    objects=$(echo -e "$data" |grep NAME |wc -l)
-    echo "{"
-    for str in $(echo -e "$data"); do
-        eval $str
-        echo -n '    "'$NAME'": {
-        "VERSION": "'$VERSION'",
-        "RELEASE": "'$RELEASE'",
-        "ARCH": "'$ARCH'",
-        "UPDATED": "'$UPDATED'",
-        "DESCR": "'$DESCR'",
-        "TIME": "'$TIME'",
-        "DATE": "'$DATE'"
-    }'
-        if [ "$i" -lt "$objects" ]; then
-            echo ','
-        else
-            echo
-        fi
-        ((i++))
-    done
-    echo '}'
-}
-
-# SHELL list function
-shell_list() {
-    IFS=$'\n'
-    echo "PKG   VER   REL   ARCH   UPDT   DATE"
-    echo "---   ---   ---   ----   ----   ----"
-    for str in $(echo -e "$data"); do
-        eval $str
-        echo "$NAME $VERSION $RELEASE $ARCH $UPDATED $DATE"
-    done
-}
-
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-# Checking official latest version
-latest=$(wget -q -T 1 -t 1 http://c.vestacp.com/latest.txt -O -)
-
-# Checking installed vesta version
-if [ -d "/etc/sysconfig" ]; then
-    rpm_format="VERSION='%{VERSION}'"
-    rpm_format="$rpm_format RELEASE='%{RELEASE}'"
-    rpm_format="$rpm_format ARCH='%{ARCH}'"
-    rpm_format="$rpm_format UTIME='%{INSTALLTIME}'\n"
-    eval $(rpm --queryformat="$rpm_format" -q vesta)
-    DATE=$(date -d @$UTIME +%F)
-    TIME=$(date -d @$UTIME +%T)
-else
-    dpkg_data=$(dpkg-query -s vesta)
-    pkg_date=$(stat -c "%Y" /var/lib/dpkg/info/vesta.list)
-    ARCH=$(echo "$dpkg_data"|grep Architecture |cut -f 2 -d ' ')
-    VERSION=$(echo "$dpkg_data"|grep ^Version |cut -f 2 -d ' '|cut -f 1 -d \-)
-    RELEASE=$(echo "$dpkg_data"|grep ^Version |cut -f 2 -d ' '|cut -f 2 -d \-)
-    DATE=$(date -d @$pkg_date +"%F")
-    TIME=$(date -d @$pkg_date +"%T")
-fi
-UPDATED='yes'
-if [ ! -z "$latest" ] && [ "$latest" \> "vesta-$VERSION-$RELEASE" ]; then
-    UPDATED='no'
-fi
-data="NAME='vesta' VERSION='$VERSION' RELEASE='$RELEASE' ARCH='$ARCH'"
-data="$data UPDATED='$UPDATED' DESCR='core package' TIME='$TIME' DATE='$DATE'"
-
-# Checking installed vesta-php version
-if [ -d "/etc/sysconfig" ]; then
-    eval $(rpm --queryformat="$rpm_format" -q vesta-php)
-    DATE=$(date -d @$UTIME +%F)
-    TIME=$(date -d @$UTIME +%T)
-else
-    dpkg_data=$(dpkg-query -s vesta-php)
-    pkg_date=$(stat -c "%Y" /var/lib/dpkg/info/vesta-php.list)
-    ARCH=$(echo "$dpkg_data"|grep Architecture | cut -f 2 -d ' ')
-    VERSION=$(echo "$dpkg_data"|grep ^Version |cut -f 2 -d ' '|cut -f 1 -d \-)
-    RELEASE=$(echo "$dpkg_data"|grep ^Version |cut -f 2 -d ' '|cut -f 2 -d \-)
-    DATE=$(date -d @$pkg_date +"%F")
-    TIME=$(date -d @$pkg_date +"%T")
-fi
-data="$data\nNAME='vesta-php' VERSION='$VERSION' RELEASE='$RELEASE'"
-data="$data ARCH='$ARCH' UPDATED='$UPDATED' DESCR='php interpreter'"
-data="$data TIME='$TIME' DATE='$DATE'"
-
-# Checking installed vesta-nginx version
-if [ -d "/etc/sysconfig" ]; then
-    eval $(rpm --queryformat="$rpm_format" -q vesta-nginx)
-    DATE=$(date -d @$UTIME +%F)
-    TIME=$(date -d @$UTIME +%T)
-else
-    dpkg_data=$(dpkg-query -s vesta-nginx)
-    pkg_date=$(stat -c "%Y" /var/lib/dpkg/info/vesta-nginx.list)
-    ARCH=$(echo "$dpkg_data"|grep Architecture | cut -f 2 -d ' ')
-    VERSION=$(echo "$dpkg_data"|grep ^Version |cut -f 2 -d ' '|cut -f 1 -d \-)
-    RELEASE=$(echo "$dpkg_data"|grep ^Version |cut -f 2 -d ' '|cut -f 2 -d \-)
-    DATE=$(date -d @$pkg_date +"%F")
-    TIME=$(date -d @$pkg_date +"%T")
-fi
-data="$data\nNAME='vesta-nginx' VERSION='$VERSION' RELEASE='$RELEASE'"
-data="$data ARCH='$ARCH' UPDATED='$UPDATED' DESCR='internal web server'"
-data="$data TIME='$TIME' DATE='$DATE'"
-
-# Checking installed vesta-ioncube version
-if [ "$SOFTACULOUS" = 'yes' ]; then
-    if [ -d "/etc/sysconfig" ]; then
-        eval $(rpm --queryformat="$rpm_format" -q vesta-ioncube)
-        DATE=$(date -d @$UTIME +%F)
-        TIME=$(date -d @$UTIME +%T)
-    else
-        dpkg_data=$(dpkg-query -s vesta-ioncube)
-        pkg_date=$(stat -c "%Y" /var/lib/dpkg/info/vesta-php.list)
-        ARCH=$(echo "$dpkg_data"|grep Architecture | cut -f 2 -d ' ')
-        VERSION=$(echo "$dpkg_data"|grep ^Vers |cut -f2 -d ' '|cut -f1 -d \-)
-        RELEASE=$(echo "$dpkg_data"|grep ^Vers |cut -f2 -d ' '|cut -f2 -d \-)
-        DATE=$(date -d @$pkg_date +"%F")
-        TIME=$(date -d @$pkg_date +"%T")
-    fi
-    data="$data\nNAME='vesta-ioncube' VERSION='$VERSION' RELEASE='$RELEASE'"
-    data="$data ARCH='$ARCH' UPDATED='$UPDATED' DESCR='php encoder'"
-    data="$data TIME='$TIME' DATE='$DATE'"
-fi
-
-# Checking installed vesta-softaculous version
-if [ "$SOFTACULOUS" = 'yes' ]; then
-    if [ -d "/etc/sysconfig" ]; then
-        eval $(rpm --queryformat="$rpm_format" -q vesta-softaculous)
-        DATE=$(date -d @$UTIME +%F)
-        TIME=$(date -d @$UTIME +%T)
-    else
-        dpkg_data=$(dpkg-query -s vesta-softaculous)
-        pkg_date=$(stat -c "%Y" /var/lib/dpkg/info/vesta-php.list)
-        ARCH=$(echo "$dpkg_data"|grep Architecture | cut -f 2 -d ' ')
-        VERSION=$(echo "$dpkg_data"|grep ^Vers |cut -f2 -d ' '|cut -f1 -d \-)
-        RELEASE=$(echo "$dpkg_data"|grep ^Vers |cut -f2 -d ' '|cut -f2 -d \-)
-        DATE=$(date -d @$pkg_date +"%F")
-        TIME=$(date -d @$pkg_date +"%T")
-    fi
-    data="$data\nNAME='vesta-softaculous' VERSION='$VERSION' RELEASE='$RELEASE'"
-    data="$data ARCH='$ARCH' UPDATED='$UPDATED' DESCR='app installer'"
-    data="$data TIME='$TIME' DATE='$DATE'"
-fi
-
-
-# Listing data
-case $format in
-    json)   json_list ;;
-    plain)  plain_list ;;
-    csv)    csv_list ;;
-    shell)  shell_list |column -t;;
-esac
-
-
-#----------------------------------------------------------#
-#                       Vesta                              #
-#----------------------------------------------------------#
-
-exit

+ 0 - 64
bin/v-update-sys-vesta

@@ -1,64 +0,0 @@
-#!/bin/bash
-# info: update vesta package/configs
-# options: PACKAGE [VERSION]
-#
-# The function runs as rpm update trigger. It pulls shell script from vesta
-# server and runs it.
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-package=$1
-
-# Importing system environment
-source /etc/profile
-
-# Includes
-source $VESTA/func/main.sh
-source $VESTA/conf/vesta.conf
-
-
-#----------------------------------------------------------#
-#                    Verifications                         #
-#----------------------------------------------------------#
-
-# Checking arg number
-check_args '1' "$#" 'PACKAGE'
-
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-if [ -d "/etc/sysconfig" ]; then
-    # Clean yum chache
-    yum -q clean all
-
-    # Define yum cmd
-    yum="yum -q -y --noplugins --disablerepo=* --enablerepo=vesta"
-
-    # Update vesta package
-    $yum update $package > /dev/null 2>&1
-    check_result $? "$package update failed" $E_UPDATE
-else
-    # Update repo
-    apt-get update -o Dir::Etc::sourcelist="sources.list.d/vesta.list" \
-        -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" -qq
-
-    # Update vesta package
-    apt-get install $package -qq > /dev/null 2>&1
-    check_result $? "$package update failed" $E_UPDATE
-fi
-
-
-#----------------------------------------------------------#
-#                       Vesta                              #
-#----------------------------------------------------------#
-
-# Logging
-log_event "$OK" "$ARGUMENTS"
-
-exit

+ 0 - 33
bin/v-update-sys-vesta-all

@@ -1,33 +0,0 @@
-#!/bin/bash
-# info: update all vesta packages
-# options: USER [RESTART]
-#
-# The function of updating all vesta packages
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Importing system variables
-source /etc/profile
-
-# Includes
-source $VESTA/func/main.sh
-source $VESTA/conf/vesta.conf
-
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-# Starting update loop
-for package in vesta vesta-nginx vesta-php vesta-ioncube vesta-softaculous; do
-    $BIN/v-update-sys-vesta "$package"
-done
-
-#----------------------------------------------------------#
-#                       Vesta                              #
-#----------------------------------------------------------#
-
-exit