Skip to content

Commit b15b5e5

Browse files
committed
fixes for license manager
1 parent 8cc1ddf commit b15b5e5

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

bin/v-activate-vesta-license

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ else
5656
sed -i "s/${module}_KEY=.*/${module}_KEY='$license'/g" $VESTA/conf/vesta.conf
5757
fi
5858

59+
# Activating sftpjail
60+
if [ "$module" = 'SFTPJAIL' ]; then
61+
setsid $BIN/v-add-sys-sftp-jail 2>/dev/null
62+
fi
63+
5964
# Logging
6065
log_event "$OK" "$EVENT"
6166

bin/v-check-vesta-license

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,15 @@ for str in $modules; do
4242
license=$(echo "$str" |cut -f 2 -d \')
4343
if [ ! -z "$license" ]; then
4444
v_host='https://vestacp.com/checkout'
45-
answer=$(curl -s $v_host/check.php?licence_key=$license)
45+
answer=$(curl -s "$v_host/check.php?licence_key=$license&module=$module")
4646
check_result $? "cant' connect to vestacp.com " 0
47+
echo "$module $license $answer"
4748
if [[ "$answer" != '0' ]]; then
48-
sed -i "s/${module}_KEY=.*/${module}_KEY=''/g" $VESTA/conf/vesta.conf
49-
echo "deactivating $module"
49+
if [ "$module" = 'SFTPJAIL' ]; then
50+
setsid $BIN/v-delete-sys-sftp-jail 2>/dev/null
51+
fi
52+
sed -i "s/${module}_KEY=.*/${module}_KEY=''/g" \
53+
$VESTA/conf/vesta.conf
5054
fi
5155
fi
5256
done

bin/v-deactivate-vesta-license

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ check_args '2' "$#" 'MODULE LICENSE'
3737
v_host='https://vestacp.com/checkout'
3838
answer=$(curl -s $v_host/cancel.php?licence_key=$license)
3939
check_result $? "cant' connect to vestacp.com " $E_CONNECT
40-
echo $answer
4140

4241
# Checking server answer
4342
if [[ "$answer" != '0' ]]; then
@@ -55,6 +54,11 @@ if [ ! -z "$(grep "${module}_KEY" $VESTA/conf/vesta.conf)" ]; then
5554
sed -i "s/${module}_KEY=.*/${module}_KEY=''/g" $VESTA/conf/vesta.conf
5655
fi
5756

57+
# Deactivating sftpjail
58+
if [ "$module" = 'SFTPJAIL' ]; then
59+
setsid $BIN/v-delete-sys-sftp-jail 2>/dev/null
60+
fi
61+
5862
# Logging
5963
log_event "$OK" "$EVENT"
6064

0 commit comments

Comments
 (0)