-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
update.sh
executable file
·38 lines (32 loc) · 961 Bytes
/
update.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
# Ensure the script is run from the directory where it is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "$SCRIPT_DIR" || exit 1
# Pull the latest changes from the repository
git pull || exit 1
# Check if `token.env` file exists
if [ ! -f token.env ]; then
echo "token.env file not found"
exit 1
fi
# Load environment variables from `token.env` file and export them
set -a
source token.env
set +a
# Check for ENABLE_FLAC env variable
if [ "$ENABLE_FLAC" = "1" ]; then
echo "FLAC is enabled"
else
export ENABLE_FLAC="0"
echo "FLAC is disabled"
fi
# Check if docker compose is available
if docker compose version &>/dev/null; then
docker compose up -d --build
# Fall back to docker-compose if docker compose is not available
elif command -v docker-compose &>/dev/null; then
docker-compose up -d --build
else
echo "Neither docker compose nor docker-compose is available"
exit 1
fi