Skip to content

Commit

Permalink
Move config.ini, user_script.sh into $HOME/.config/vpngate-with-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
ductin committed Apr 23, 2017
1 parent b145717 commit f9621b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions vpnproxy_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, data):
self.country_short = data[6]
self.NumSessions = data[7]
self.uptime = data[8]
self.logPolicy = data[11]
self.logPolicy = "2wk" if data[11]=="2weeks" else "inf"
self.config_data = base64.b64decode(data[-1])
self.proto = 'tcp' if '\r\nproto tcp\r\n' in self.config_data else 'udp'
port = re.findall('remote .+ \d+', self.config_data)
Expand Down Expand Up @@ -392,7 +392,7 @@ def vpn_manager(ovpn):
if not os.path.exists("config.ini"):
os.symlink(config_file, "config.ini")

if not os.path.exists(user_script_file):
if not os.path.exists("user_script.sh"):
call(["cp", "user_script.sh.tmp", user_script_file])
os.symlink(user_script_file, "user_script.sh")

Expand Down Expand Up @@ -433,8 +433,8 @@ def vpn_manager(ovpn):
dns_manager()
ranked, vpn_list = refresh_data()

labels = ['Idx', 'Geo', 'Ping', 'Speed', 'Up', 'Log', 'Score', 'proto', 'Ip', 'Port']
spaces = [5, 5, 7, 8, 8, 8, 8, 5, 19, 6]
labels = ['Idx', 'Geo', 'Ping', 'Speed', 'UpTime', 'Log', 'Score', 'proto', 'Ip', 'Port']
spaces = [5, 4, 5, 8, 12, 4, 8, 6, 16, 6]
labels = [label.center(spaces[ind]) for ind, label in enumerate(labels)]
connected_servers = []

Expand Down
2 changes: 1 addition & 1 deletion vpnproxy_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def __init__(self):
if not os.path.exists("config.ini"):
os.symlink(self.config_file, "config.ini")

if not os.path.exists(self.user_script_file):
if not os.path.exists("user_script.sh"):
call(["cp", "user_script.sh.tmp", self.user_script_file])
os.symlink(self.user_script_file, "user_script.sh")

Expand Down

0 comments on commit f9621b3

Please sign in to comment.