Skip to content

Instantly share code, notes, and snippets.

@gilgamez
Last active December 28, 2015 09:49
Show Gist options
  • Save gilgamez/7481323 to your computer and use it in GitHub Desktop.
Save gilgamez/7481323 to your computer and use it in GitHub Desktop.
my companion script to kick a sshuttle session into action. sshuttle is here https://github.com/apenwarr/sshuttle
#!/bin/bash
SSH_SERVER=<some host config ssh understands>
VERBOSITY=-v
cat <<-EOF |
# My Project
172.16.103.183/29 # buildserver
172.16.228.219/28 # issuetracker
172.16.228.246/26 # test
172.16.40.175/28 # acc
172.16.172.37/24 # prd
# Common servers
172.16.29.208/29 # subversion
EOF
sed 's/#.*//;s/ //g;' | # strip comments
grep -v '^$' | # remove empty lines
paste -sd ' ' - | # join all lines to a single line
(
read NETWORKS
exec sshuttle $VERBOSITY -r $SSH_SERVER $NETWORKS
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment