rclone/fstest/testserver/init.d/docker.bash
Florian Klink aed77a8fb2 tree-wide: replace /bin/bash with /usr/bin/env bash
The latter is more portable, while the former only works on systems
where /bin/bash exists (or is symlinked appropriately).
2024-06-11 12:47:47 +01:00

23 lines
431 B
Bash

#!/usr/bin/env bash
stop() {
if status ; then
docker stop "$NAME"
echo "$NAME stopped"
fi
}
status() {
if docker ps --format '{{.Names}}' | grep -q "^${NAME}$" ; then
echo "$NAME running"
else
echo "$NAME not running"
return 1
fi
return 0
}
docker_ip() {
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{"\n"}}{{end}}' "$NAME" | head -1
}