containers/docker-upgrade.sh

25 lines
561 B
Bash
Raw Permalink Normal View History

2022-07-24 20:28:08 +02:00
#!/usr/bin/env bash
# Upgrade CODE Docker
code() {
docker pull collabora/code:latest | grep 'Image is up to date' && pulled='no' || pulled='yes'
if [[ "$pulled" = "yes" ]]; then
echo "$(date +%+4Y-%m-%d): Update" >> $logfile_path
docker stop CODE
docker rm CODE
docker run --name 'CODE' -t -d -p 9980:9980 -e 'domain=cloud\\.kto\\.black' --network host --restart always collabora/code
else
echo "$(date +%+4Y-%m-%d): No update" >> $logfile_path
fi
}
# Variables
logfile_path='/home/alex/docker-upgrade.log'
set -ex
code
exit 0