|
|
@@ -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
|