Files
sshuttle-connect/sshuttle.sh

48 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
########################################################################
# Copyright (C) 2014 Max Mehl <mail@mehl.mx>
########################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
########################################################################
#
# sshuttle is a "poor man's VPN". You can quickly change your IP by
# surfing over the SSH connection of one of your hosts.
# This script makes it easy if you have many hosts which you want to use
#
########################################################################
cd "$(dirname "$(readlink -f "$0")")"
# Test if config.cfg exists and set needed variables
if [ ! -e config.cfg ]; then echo "Missing config.cfg file. Edit and rename config.cfg.sample"; exit 1; fi
source config.cfg
for ((i = 0; i < ${#SERVER[*]}; i++)); do
echo "$i. ${SERVER[$i]}"
done
read -p "Which SSH-Server to use? " number
if [ $number = 0 ]; then
read -p "Type in server to use: " HOST
else
HOST=${SERVER[$number]}
fi
sshuttle -r $HOST 0.0.0.0/0