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 May 5, 2017
1 parent 6146ff5 commit aedbba3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions vpnproxy_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ def signal_term_handler(signal, frame):
get_input(cfg, args)

else:
if not os.path.exists(os.path.expanduser('~/.config/vpngate-with-proxy')):
os.makedirs(os.path.expanduser('~/.config/vpngate-with-proxy'))
if not os.path.exists(user_home+'/.config/vpngate-with-proxy'):
os.makedirs(user_home+'/.config/vpngate-with-proxy')

print '\n' + '_' * 12 + ctext(' First time config ', 'gB') + '_' * 12 + '\n'

Expand Down
5 changes: 3 additions & 2 deletions vpnproxy_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def __repr__(self):
class Connection:
def __init__(self):
self.path = os.path.realpath(sys.argv[0])
self.user_home = sys.argv[1]
self.config_file = sys.argv[1] + '/.config/vpngate-with-proxy/config.ini'
self.user_script_file = sys.argv[1] + '/.config/vpngate-with-proxy/user_script.sh'
self.cfg = Setting(self.config_file)
Expand Down Expand Up @@ -174,8 +175,8 @@ def rewrite(self, section, **contents):
self.reload()

def first_config(self):
if not os.path.exists(os.path.expanduser('~/.config/vpngate-with-proxy')):
os.makedirs(os.path.expanduser('~/.config/vpngate-with-proxy'))
if not os.path.exists(self.user_home + '/.config/vpngate-with-proxy'):
os.makedirs(self.user_home + '/.config/vpngate-with-proxy')

print '\n' + '_' * 12 + ctext(' First time config ', 'gB') + '_' * 12 + '\n'
self.cfg.proxy['use_proxy'] = 'no' if raw_input(
Expand Down

0 comments on commit aedbba3

Please sign in to comment.