Skip to content

Instantly share code, notes, and snippets.

@tonyedwardspz
Created July 22, 2023 18:34
Show Gist options
  • Save tonyedwardspz/f98edd13edd59b956341c03d42386968 to your computer and use it in GitHub Desktop.
Save tonyedwardspz/f98edd13edd59b956341c03d42386968 to your computer and use it in GitHub Desktop.
Script to update Audiobookshelf server in one command
#!/bin/bash
# Replace /path/to/your/docker-compose/directory with the directory path where your docker-compose.yml resides
# Save this somewhere apropriate and give it executable permissions with chmod +x update_audiobookshelf.sh
# You can then run it with ./update_audiobookshelf.sh
# Navigate to the directory where your docker-compose.yml file resides
cd /path/to/your/docker-compose/directory
# Stop the running container
echo "Stopping running container..."
docker-compose down
# Pull the latest image from Docker Hub
echo "Pulling the latest image..."
docker-compose pull ghcr.io/advplyr/audiobookshelf:latest
# Rebuild the container from the freshly updated image and relaunch
echo "Rebuilding and relaunching the container..."
docker-compose up -d --remove-orphans --force-recreate --build
# Prune any outdated images
echo "Pruning outdated images..."
docker image prune -f
echo "Audiobookshelf update process completed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment