summaryrefslogtreecommitdiff
path: root/src/launch-without-proxy-settings.py
blob: fc09a6e74bf9ee3a12b2ac515575402110d127b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python

# launches an app after first clearing proxy settings
# for example, launch-without-proxy-settings gupnp-av-cp


import os
import sys
from subprocess import call


try:
  #print os.environ;
  del os.environ["http_proxy"];
  del os.environ["https_proxy"];
  del os.environ["ftp_proxy"];
  del os.environ["socks_proxy"];
  del os.environ["no_proxy"];

  print '\n';
  print '\n';

  #print os.environ;
except Exception, e:
  print e;
  pass

if len(sys.argv) >= 1:
  print "launching " + sys.argv[1];
  call([sys.argv[1]]);