Mbonea commited on
Commit
4cedc0e
·
1 Parent(s): c39937b

added ovpn path correctly

Browse files
Files changed (1) hide show
  1. App/app.py +6 -2
App/app.py CHANGED
@@ -12,7 +12,7 @@ from .Metrics.MetricsRoutes import metrics_router
12
  from .Messages.MessagesRoute import message_router
13
 
14
  # from .Subscriptions.background_tasks import check_expiring_subscriptions
15
- import asyncio
16
  import logging
17
  import subprocess
18
 
@@ -38,7 +38,11 @@ async def connect_to_vpn():
38
  try:
39
  # Replace 'your_vpn_command' with the actual command to connect to your VPN
40
  # For example, if using OpenVPN:
41
- command = ["openvpn", "--config", "App/Mikrotik/utils/client1-working.ovpn"]
 
 
 
 
42
  process = subprocess.Popen(command)
43
  await asyncio.sleep(5) # Wait for a few seconds to ensure the VPN connects
44
  logging.info("VPN connected successfully.")
 
12
  from .Messages.MessagesRoute import message_router
13
 
14
  # from .Subscriptions.background_tasks import check_expiring_subscriptions
15
+ import asyncio, os
16
  import logging
17
  import subprocess
18
 
 
38
  try:
39
  # Replace 'your_vpn_command' with the actual command to connect to your VPN
40
  # For example, if using OpenVPN:
41
+ command = [
42
+ "openvpn",
43
+ "--config",
44
+ f"{os.path.dirname(__file__)}/Mikrotik/utils/client1-working.ovpn",
45
+ ]
46
  process = subprocess.Popen(command)
47
  await asyncio.sleep(5) # Wait for a few seconds to ensure the VPN connects
48
  logging.info("VPN connected successfully.")