Find Jobs
Hire Freelancers

Update Script for openvpn

$10-30 USD

Closed
Posted over 2 years ago

$10-30 USD

Paid on delivery
want to set client connection limit, so that only 3 device from user can connect at a time. please see example: [login to view URL] -or- [login to view URL] client-connect scripts/[login to view URL] # #!/bin/bash . /etc/openvpn/scripts/[login to view URL] . /etc/openvpn/scripts/[login to view URL] common_name=$(echap "$common_name") trusted_ip=$(echap "$trusted_ip") trusted_port=$(echap "$trusted_port") ifconfig_pool_remote_ip=$(echap "$ifconfig_pool_remote_ip") remote_port_1=$(echap "$remote_port_1") bytes_received=$(echap "$bytes_received") bytes_sent=$(echap "$bytes_sent") # Prevent the error : ERROR 1366 (22007) at line 1: Incorrect double value: '' for column 'log_received' at row 1 if [ -z "$bytes_received" ] then bytes_received=0 fi if [ -z "$bytes_sent" ] then bytes_sent=0 fi # We insert data in the log table mysql -h$HOST -P$PORT -u$USER -p$PASS $DB -e "INSERT INTO log (log_id, user_id, log_trusted_ip, log_trusted_port, log_remote_ip, log_remote_port, log_start_time, log_end_time, log_received, log_send) VALUES(NULL, '$common_name','$trusted_ip', '$trusted_port','$ifconfig_pool_remote_ip', '$remote_port_1', now(),NULL, '$bytes_received', '$bytes_sent')" # We specify that the user is online mysql -h$HOST -P$PORT -u$USER -p$PASS $DB -e "UPDATE user SET user_online=1 WHERE user_id='$common_name'" # client-disconnect scripts/[login to view URL] # #!/bin/bash . /etc/openvpn/scripts/[login to view URL] . /etc/openvpn/scripts/[login to view URL] 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") # We specify the user is offline mysql -h$HOST -P$PORT -u$USER -p$PASS $DB -e "UPDATE user SET user_online=0 WHERE user_id='$common_name'" # We insert the deconnection datetime 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" #
Project ID: 31835304

About the project

2 proposals
Remote project
Active 2 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
2 freelancers are bidding on average $110 USD for this job
User Avatar
Hi, I can do it. Please send me more detail information. I have got experience 4+ years about devops. Regards, --Hung
$20 USD in 7 days
5.0 (5 reviews)
4.5
4.5
User Avatar
Hello, I hope this finds you well. I have just seen your project requiring; PHP Linux Software Architecture Shell Script OpenVPN I believe that my 10-year experience in this field is what you need right away. Avoid the headache of looking further. Let's save time and focus on the real task. My proposed timelines and budget are just placeholder and an open for negotiation to increase or decrease as per the full requirements at hand. Allow me to prove how better my review can be. Smile all the way! Click the message button, so initiate the conversation. Regards, Fridah
$200 USD in 7 days
3.7 (20 reviews)
5.7
5.7

About the client

Flag of UNITED STATES
LYNWOOD, United States
5.0
17
Payment method verified
Member since Mar 4, 2014

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.