Просмотр исходного кода

Remove licensing parts from bin and backup script.

Raphael Schneeberger 7 лет назад
Родитель
Сommit
5d699e5db4
4 измененных файлов с 0 добавлено и 197 удалено
  1. 0 67
      bin/v-activate-vesta-license
  2. 0 2
      bin/v-backup-users
  3. 0 63
      bin/v-check-vesta-license
  4. 0 65
      bin/v-deactivate-vesta-license

+ 0 - 67
bin/v-activate-vesta-license

@@ -1,67 +0,0 @@
-#!/bin/bash
-# info: activate vesta license
-# options: MODULE LICENSE
-#
-# The function activates and registers the vesta license
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-module=$(echo $1 | tr '[:lower:]' '[:upper:]')
-license=$2
-
-# Importing system environment
-source /etc/profile
-
-# Includes
-source $HESTIA/func/main.sh
-source $HESTIA/conf/hestia.conf
-
-
-#----------------------------------------------------------#
-#                    Verifications                         #
-#----------------------------------------------------------#
-
-# Checking arg number
-check_args '2' "$#" 'MODULE LICENSE'
-
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-# Activating license
-v_host='https://vestacp.com/checkout'
-answer=$(curl -s $v_host/activate.php?licence_key=$license&module=$module)
-check_result $? "cant' connect to vestacp.com " $E_CONNECT
-
-# Checking server answer
-if [[ "$answer" != '0' ]]; then
-    echo "Error: $module license $license is invalid"
-    exit $E_INVALID
-fi
-
-
-#----------------------------------------------------------#
-#                       Hestia                             #
-#----------------------------------------------------------#
-
-# Updating hestia.conf
-if [ -z "$(grep "${module}_KEY" $HESTIA/conf/hestia.conf)" ]; then
-    echo "${module}_KEY='$license'" >> $HESTIA/conf/hestia.conf
-else
-    sed -i "s/${module}_KEY=.*/${module}_KEY='$license'/g" $HESTIA/conf/hestia.conf
-fi
-
-# Activating sftpjail
-if [ "$module" = 'SFTPJAIL' ]; then
-    setsid $BIN/v-add-sys-sftp-jail 2>/dev/null
-fi
-
-# Logging
-log_event "$OK" "$ARGUMENTS"
-
-exit

+ 0 - 2
bin/v-backup-users

@@ -22,8 +22,6 @@ source $HESTIA/conf/hestia.conf
 #                       Action                             #
 #----------------------------------------------------------#
 
-$BIN/v-check-vesta-license >/dev/null
-
 if [ -z "$BACKUP_SYSTEM" ]; then
     exit
 fi

+ 0 - 63
bin/v-check-vesta-license

@@ -1,63 +0,0 @@
-#!/bin/bash
-# info: check vesta license
-# options: [MODULE]
-#
-# The function activates and register vesta license
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-module=$(echo $1 | tr '[:lower:]' '[:upper:]')
-
-# Importing system environment
-source /etc/profile
-
-# Includes
-source $HESTIA/func/main.sh
-source $HESTIA/conf/hestia.conf
-
-
-#----------------------------------------------------------#
-#                    Verifications                         #
-#----------------------------------------------------------#
-
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-# Checking module
-if [ -z "$module" ]; then
-    modules=$(grep _KEY= $HESTIA/conf/hestia.conf)
-else
-    modules=$(grep "${module}_KEY" $HESTIA/conf/hestia.conf)
-fi
-
-IFS=$'\n'
-for str in $modules; do
-    module=$(echo "$str" |cut -f 1 -d _)
-    license=$(echo "$str" |cut -f 2 -d \')
-    if [ ! -z "$license" ]; then
-        v_host='https://vestacp.com/checkout'
-        answer=$(curl -s "$v_host/check.php?licence_key=$license&module=$module")
-        check_result $? "cant' connect to vestacp.com " 0
-        echo "$module $license $answer"
-        if [[ "$answer" != '0' ]]; then
-            if [ "$module" = 'SFTPJAIL' ]; then
-                setsid $BIN/v-delete-sys-sftp-jail 2>/dev/null
-            fi
-            sed -i "s/${module}_KEY=.*/${module}_KEY=''/g" \
-                $HESTIA/conf/hestia.conf
-        fi
-    fi
-done
-
-
-#----------------------------------------------------------#
-#                       Hestia                             #
-#----------------------------------------------------------#
-
-exit

+ 0 - 65
bin/v-deactivate-vesta-license

@@ -1,65 +0,0 @@
-#!/bin/bash
-# info: deactivate vesta license
-# options: MODULE LICENSE
-#
-# The function deactivates vesta license
-
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Argument definition
-module=$(echo $1 | tr '[:lower:]' '[:upper:]')
-license=$2
-
-# Importing system environment
-source /etc/profile
-
-# Includes
-source $HESTIA/func/main.sh
-source $HESTIA/conf/hestia.conf
-
-
-#----------------------------------------------------------#
-#                    Verifications                         #
-#----------------------------------------------------------#
-
-# Checking arg number
-check_args '2' "$#" 'MODULE LICENSE'
-
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-# Activating license
-v_host='https://vestacp.com/checkout'
-answer=$(curl -s $v_host/cancel.php?licence_key=$license)
-check_result $? "cant' connect to vestacp.com " $E_CONNECT
-
-# Checking server answer
-if [[ "$answer" != '0' ]]; then
-    echo "Error: $module license $license is invalid"
-    exit $E_INVALID
-fi
-
-
-#----------------------------------------------------------#
-#                       Hestia                             #
-#----------------------------------------------------------#
-
-# Updating hestia.conf
-if [ ! -z "$(grep "${module}_KEY" $HESTIA/conf/hestia.conf)" ]; then
-    sed -i "s/${module}_KEY=.*/${module}_KEY=''/g" $HESTIA/conf/hestia.conf
-fi
-
-# Deactivating sftpjail
-if [ "$module" = 'SFTPJAIL' ]; then
-    setsid $BIN/v-delete-sys-sftp-jail 2>/dev/null
-fi
-
-# Logging
-log_event "$OK" "$ARGUMENTS"
-
-exit