mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 05:44:07 -07:00
fixes for license manager
This commit is contained in:
parent
8cc1ddf101
commit
b15b5e5cbd
3 changed files with 17 additions and 4 deletions
|
@ -56,6 +56,11 @@ else
|
|||
sed -i "s/${module}_KEY=.*/${module}_KEY='$license'/g" $VESTA/conf/vesta.conf
|
||||
fi
|
||||
|
||||
# Activating sftpjail
|
||||
if [ "$module" = 'SFTPJAIL' ]; then
|
||||
setsid $BIN/v-add-sys-sftp-jail 2>/dev/null
|
||||
fi
|
||||
|
||||
# Logging
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
|
|
|
@ -42,11 +42,15 @@ for str in $modules; do
|
|||
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)
|
||||
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
|
||||
sed -i "s/${module}_KEY=.*/${module}_KEY=''/g" $VESTA/conf/vesta.conf
|
||||
echo "deactivating $module"
|
||||
if [ "$module" = 'SFTPJAIL' ]; then
|
||||
setsid $BIN/v-delete-sys-sftp-jail 2>/dev/null
|
||||
fi
|
||||
sed -i "s/${module}_KEY=.*/${module}_KEY=''/g" \
|
||||
$VESTA/conf/vesta.conf
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -37,7 +37,6 @@ check_args '2' "$#" 'MODULE 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
|
||||
echo $answer
|
||||
|
||||
# Checking server answer
|
||||
if [[ "$answer" != '0' ]]; then
|
||||
|
@ -55,6 +54,11 @@ if [ ! -z "$(grep "${module}_KEY" $VESTA/conf/vesta.conf)" ]; then
|
|||
sed -i "s/${module}_KEY=.*/${module}_KEY=''/g" $VESTA/conf/vesta.conf
|
||||
fi
|
||||
|
||||
# Deactivating sftpjail
|
||||
if [ "$module" = 'SFTPJAIL' ]; then
|
||||
setsid $BIN/v-delete-sys-sftp-jail 2>/dev/null
|
||||
fi
|
||||
|
||||
# Logging
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue