Răsfoiți Sursa

fixes for license manager

Serghey Rodin 10 ani în urmă
părinte
comite
b15b5e5cbd

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

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

+ 7 - 3
bin/v-check-vesta-license

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

+ 5 - 1
bin/v-deactivate-vesta-license

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