Repository URL to install this package:
|
Version:
1.3.0 ▾
|
ff-editor
/
stop.sh
|
|---|
#!/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