Created
November 12, 2025 14:36
-
-
Save kierun/8bcab2208742335bbf833ceb7747a987 to your computer and use it in GitHub Desktop.
An overengineered script to update containers for tt-rss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tt-rss/tt-rss#149