Skip to content

Instantly share code, notes, and snippets.

@kierun
Created November 12, 2025 14:36
Show Gist options
  • Select an option

  • Save kierun/8bcab2208742335bbf833ceb7747a987 to your computer and use it in GitHub Desktop.

Select an option

Save kierun/8bcab2208742335bbf833ceb7747a987 to your computer and use it in GitHub Desktop.
An overengineered script to update containers for tt-rss
#!/bin/bash
# ⚠️ This is massively over engineered. You have been warned.
# Nifty colours.
#
# Colours for echo commands.
# For colour codes, see https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
error=$(tput setaf 9) # bright red.
success=$(tput setaf 2) # normal green.
# warning=$(tput setaf 214) # orange.
info=$(tput setaf 99) # purple.
debug=$(tput setaf 240) # grey.
reset=$(tput sgr0)
# Separator: a line to deliminate sections.
sep() {
echo -ne "${debug}"
cols=$(tput cols)
for ((i = 1; i < cols; i++)); do printf "_"; done
echo "${resset}"
}
sep
# Pull the images.
echo "${info}Pulling images…${reset}"
docker compose pull --include-deps
retcode=$?
if [ $retcode -ne 0 ]; then
echo "${error}Docker compose error: $retcode${reset}"
exit $retcode
fi
sep
# Restart the containers.
echo "${info}Restarting containers…${reset}"
docker compose up --detach --remove-orphans
retcode=$?
if [ $retcode -ne 0 ]; then
echo "${error}Docker compose error: $retcode${reset}"
exit $retcode
fi
sep
# Just checking this is working…
echo "${info}Checking status...${reset}"
systemctl status docker
@kierun
Copy link
Author

kierun commented Nov 14, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment