github.com/xhghs/rclone@v1.51.1-0.20200430155106-e186a28cced8/fstest/testserver/init.d/docker.bash (about) 1 #!/bin/bash 2 3 stop() { 4 if status ; then 5 docker stop $NAME 6 echo "$NAME stopped" 7 fi 8 } 9 10 status() { 11 if docker ps --format "{{.Names}}" | grep ^${NAME}$ >/dev/null ; then 12 echo "$NAME running" 13 else 14 echo "$NAME not running" 15 return 1 16 fi 17 return 0 18 } 19 20 docker_ip() { 21 docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $NAME 22 }