mirror of
https://github.com/rclone/rclone.git
synced 2024-12-19 09:13:43 +08:00
acd5a893e2
* head -number is not allowed by POSIX.1-2024: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/head.html https://devmanual.gentoo.org/tools-reference/head-and-tail/index.html
23 lines
433 B
Bash
23 lines
433 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 -n 1
|
|
}
|