-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·26 lines (20 loc) · 997 Bytes
/
update.sh
File metadata and controls
executable file
·26 lines (20 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/bash
COMPOSE_FILE="/home/andrew/docker/docker-compose.denmesh.yml"
# 1. Stop the server to free up RAM and Image locks
sudo docker compose -f $COMPOSE_FILE stop
# 2. Clear out old Docker bloat to make room for the pull
sudo docker system prune -af
# 3. The "Do-It-All" Update
# topgrade runs 'dnf upgrade' automatically.
# --Edit: It's 'dnf update -y' --- you're thinking of Debian based distros that use apt-get, e.g. 'apt-get update', and then 'apt-get upgrade' to actually do the update
sudo dnf update -y
# Adding --cleanup tells topgrade to run the autoremove logic for you.
# --Edit: You are not supposed to run 'dnf autoremove' everytime after running 'dnf update'
topgrade --disable firmware
# 4. Pull the new images and restart
sudo docker compose -f $COMPOSE_FILE pull
sudo docker compose -f $COMPOSE_FILE up -d
# 5. Make sure the Postfix/Dovecot/mariaDB services are running
sudo systemctl restart postfix
sudo systemctl restart dovecot
sudo systemctl restart mariaDB