docker-tools/_get_container.sh

14 lines
303 B
Bash
Raw Normal View History

2021-11-02 13:38:12 +00:00
#!/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