mirror of
https://github.com/Ysurac/openmptcprouter-vps-admin.git
synced 2025-03-09 15:40:05 +00:00
Less verbose script
This commit is contained in:
parent
c65a9d2f6c
commit
05dfbf09aa
1 changed files with 8 additions and 5 deletions
13
omr-admin.py
13
omr-admin.py
|
@ -22,6 +22,9 @@ from flask_jwt_simple import (
|
|||
|
||||
app = Flask(__name__)
|
||||
|
||||
import logging
|
||||
log = logging.getLogger('werkzeug')
|
||||
log.setLevel(logging.ERROR)
|
||||
# Setup the Flask-JWT-Simple extension
|
||||
|
||||
# Generate a random secret key
|
||||
|
@ -279,11 +282,11 @@ def mptcp():
|
|||
congestion_control = params.get('congestion_control', None)
|
||||
if not checksum or not path_manager or not scheduler or not syn_retries or not congestion_control:
|
||||
return jsonify({'result': 'error','reason': 'Invalid parameters','route': 'mptcp'})
|
||||
os.system('sysctl -w net.mptcp.mptcp_checksum=' + checksum)
|
||||
os.system('sysctl -w net.mptcp.mptcp_path_manager=' + path_manager)
|
||||
os.system('sysctl -w net.mptcp.mptcp_scheduler=' + scheduler)
|
||||
os.system('sysctl -w net.mptcp.mptcp_syn_retries=' + syn_retries)
|
||||
os.system('sysctl -w net.ipv4.tcp_congestion_control=' + congestion_control)
|
||||
os.system('sysctl -qw net.mptcp.mptcp_checksum=' + checksum)
|
||||
os.system('sysctl -qw net.mptcp.mptcp_path_manager=' + path_manager)
|
||||
os.system('sysctl -qw net.mptcp.mptcp_scheduler=' + scheduler)
|
||||
os.system('sysctl -qw net.mptcp.mptcp_syn_retries=' + syn_retries)
|
||||
os.system('sysctl -qw net.ipv4.tcp_congestion_control=' + congestion_control)
|
||||
return jsonify({'result': 'done','reason': 'changes applied'})
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue