Skip to content

Commit

Permalink
Added --exclude-from feature.
Browse files Browse the repository at this point in the history
(Slightly modified by apenwarr)
  • Loading branch information
tianyicui authored and apenwarr committed Jul 6, 2012
1 parent bff1610 commit 29d2e06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Documentation/sshuttle.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ entire subnet to the VPN.
`0/0 -x 1.2.3.0/24` to forward everything except the
local subnet over the VPN, for example.

--exclude-from=*file*
: exclude the subnets specified in a file, one subnet per
line. Useful when you have lots of subnets to exclude.

-v, --verbose
: print more information about the session. This option
can be used more than once for increased verbosity. By
Expand Down
3 changes: 3 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def parse_ipport(s):
python= path to python interpreter on the remote server
r,remote= ssh hostname (and optional username) of remote sshuttle server
x,exclude= exclude this subnet (can be used more than once)
exclude-from= exclude the subnets in a file (whitespace separated)
v,verbose increase debug message verbosity
e,ssh-cmd= the command to use to connect to the remote [ssh]
seed-hosts= with -H, use these hostnames for initial scan (comma-separated)
Expand Down Expand Up @@ -104,6 +105,8 @@ def parse_ipport(s):
for k,v in flags:
if k in ('-x','--exclude'):
excludes.append(v)
if k in ('-X', '--exclude-from'):
excludes += open(v).read().split()
remotename = opt.remote
if remotename == '' or remotename == '-':
remotename = None
Expand Down

0 comments on commit 29d2e06

Please sign in to comment.