You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
706 B
16 lines
706 B
11 years ago
|
#!/bin/bash
|
||
|
. /etc/openvpn/scripts/config.sh
|
||
9 years ago
|
. /etc/openvpn/scripts/functions.sh
|
||
|
|
||
|
common_name=$(echap "$common_name")
|
||
|
bytes_received=$(echap "$bytes_received")
|
||
|
bytes_sent=$(echap "$bytes_sent")
|
||
|
trusted_ip=$(echap "$trusted_ip")
|
||
|
trusted_port=$(echap "$trusted_port")
|
||
11 years ago
|
|
||
10 years ago
|
# We specify the user is offline
|
||
11 years ago
|
mysql -h$HOST -P$PORT -u$USER -p$PASS $DB -e "UPDATE user SET user_online=0 WHERE user_id='$common_name'"
|
||
|
|
||
10 years ago
|
# We insert the deconnection datetime
|
||
8 years ago
|
mysql -h$HOST -P$PORT -u$USER -p$PASS $DB -e "UPDATE log SET log_end_time=now(), log_received='$bytes_received', log_send='$bytes_sent' WHERE log_trusted_ip='$trusted_ip' AND log_trusted_port='$trusted_port' AND user_id='$common_name' AND log_end_time IS NULL"
|