1
1
mirror of https://github.com/sshuttle/sshuttle.git synced 2025-07-14 21:45:33 +02:00
Files
.github
docs
scripts
Containerfile
README.md
compose.yml
container.setup.sh
exec-sshuttle
exec-tool
run-benchmark
run-checks
test-bed
sshuttle
tests
.envrc
.gitignore
.prospector.yml
.readthedocs.yaml
.tool-versions
CHANGES.rst
LICENSE
MANIFEST.in
README.rst
bandit.yml
flake.lock
flake.nix
poetry.lock
pyproject.toml
requirements-tests.txt
requirements.txt
run
setup.cfg
setup.py
tox.ini
sshuttle/scripts/test-bed

43 lines
791 B
Bash
Executable File

#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
if [[ -z $1 || $1 = -* ]]; then
set -- up "$@"
fi
function with_set_x() {
set -x
"$@"
{
ec=$?
set +x
return $ec
} 2>/dev/null
}
function build() {
# podman build -t ghcr.io/sshuttle/sshuttle-testbed .
with_set_x docker build --progress=plain -t ghcr.io/sshuttle/sshuttle-testbed -f Containerfile .
}
function compose() {
# podman-compose "$@"
with_set_x docker compose "$@"
}
function get-ip() {
local container_name=sshuttle-testbed-"$1"
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$container_name"
}
if [[ $1 == get-ip ]]; then
shift
get-ip "$@"
else
if [[ $* = *--build* ]]; then
build
fi
compose "$@"
fi