fixes for license manager

This commit is contained in:
Serghey Rodin 2015-11-03 00:58:39 +02:00
commit b15b5e5cbd
3 changed files with 17 additions and 4 deletions

View file

@ -56,6 +56,11 @@ else
sed -i "s/${module}_KEY=.*/${module}_KEY='$license'/g" $VESTA/conf/vesta.conf sed -i "s/${module}_KEY=.*/${module}_KEY='$license'/g" $VESTA/conf/vesta.conf
fi fi
# Activating sftpjail
if [ "$module" = 'SFTPJAIL' ]; then
setsid $BIN/v-add-sys-sftp-jail 2>/dev/null
fi
# Logging # Logging
log_event "$OK" "$EVENT" log_event "$OK" "$EVENT"

View file

@ -42,11 +42,15 @@ for str in $modules; do
license=$(echo "$str" |cut -f 2 -d \') license=$(echo "$str" |cut -f 2 -d \')
if [ ! -z "$license" ]; then if [ ! -z "$license" ]; then
v_host='https://vestacp.com/checkout' 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 check_result $? "cant' connect to vestacp.com " 0
echo "$module $license $answer"
if [[ "$answer" != '0' ]]; then if [[ "$answer" != '0' ]]; then
sed -i "s/${module}_KEY=.*/${module}_KEY=''/g" $VESTA/conf/vesta.conf if [ "$module" = 'SFTPJAIL' ]; then
echo "deactivating $module" 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
fi fi
done done

View file

@ -37,7 +37,6 @@ check_args '2' "$#" 'MODULE LICENSE'
v_host='https://vestacp.com/checkout' v_host='https://vestacp.com/checkout'
answer=$(curl -s $v_host/cancel.php?licence_key=$license) answer=$(curl -s $v_host/cancel.php?licence_key=$license)
check_result $? "cant' connect to vestacp.com " $E_CONNECT check_result $? "cant' connect to vestacp.com " $E_CONNECT
echo $answer
# Checking server answer # Checking server answer
if [[ "$answer" != '0' ]]; then 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 sed -i "s/${module}_KEY=.*/${module}_KEY=''/g" $VESTA/conf/vesta.conf
fi fi
# Deactivating sftpjail
if [ "$module" = 'SFTPJAIL' ]; then
setsid $BIN/v-delete-sys-sftp-jail 2>/dev/null
fi
# Logging # Logging
log_event "$OK" "$EVENT" log_event "$OK" "$EVENT"