Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
ff-editor / stop.sh
Size: Mime:
#!/bin/sh
UTILS=${UTILS:="$(pwd)/../utils.sh"}
if [ -x "${UTILS}" ]; then
    . ${UTILS}
    DEBUG=$(type -t message)
fi

if [ -z "${DEBUG}" ]; then
    message () {
        echo $1
    }
fi

CONTAINER=${CONTAINER:="ffeditor"}
EXISTING=$(docker ps -qaf name=${CONTAINER})
if [ -n "${EXISTING}" ]; then
    message "Removing old ${CONTAINER}"
    EXISTING=$(docker stop ${CONTAINER})
    if [ -z "${REMOVE}" ]; then
        docker rm ${EXISTING} &> /dev/null
        echo "[OK]"
    else
        # Remove volumes as well
        docker rm -v ${EXISTING} &> /dev/null
        echo "[OK]"
    fi
fi