containers/docker-upgrade.sh
Alexandre CATTEAU ee007e28fb Initial commit
2022-07-24 20:28:08 +02:00

25 lines
561 B
Bash

#!/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