docker-tools/_get_container.sh
2021-11-02 14:38:12 +01:00

14 lines
303 B
Bash

#!/bin/sh
if [ -z "$1" ]; then
base=`realpath . --relative-to="/data/containers" | cut -d"/" -f1`
if [ "$base" = ".." -o "$base" = "." ]; then
echo "No container given and not within /data/containers"
exit 1
fi
container="$base"
echo "Working on container $container."
else
container="$1"
fi