Update komodo.sh (#1403)

This commit is contained in:
Michel Roegl-Brunner 2025-01-10 16:47:06 +01:00 committed by GitHub
parent 0c0225a052
commit 111436c0a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,9 +34,9 @@ function update_script() {
fi
msg_info "Updating ${APP}"
COMPOSE_FILE=""
for file in *.compose.yaml; do
for file in /opt/komodo/*.compose.yaml; do
if [[ "$file" != "compose.env" ]]; then
COMPOSE_FILE="$file"
COMPOSE_FILE="${file#/opt/komodo/}"
break
fi
done
@ -47,15 +47,15 @@ function update_script() {
fi
BACKUP_FILE="${COMPOSE_FILE}.bak_$(date +%Y%m%d_%H%M%S)"
mv "$COMPOSE_FILE" "$BACKUP_FILE" || {
mv "/opt/komodo/$COMPOSE_FILE" "/opt/komodo/$BACKUP_FILE" || {
msg_error "Failed to create backup of $COMPOSE_FILE!"
exit 1
}
GITHUB_URL="https://raw.githubusercontent.com/mbecker20/komodo/main/compose/$COMPOSE_FILE"
wget -q -O "$COMPOSE_FILE" "$GITHUB_URL" || {
msg_error "Failed to download $COMPOSE_FILE from GitHub!"
mv "$BACKUP_FILE" "$COMPOSE_FILE"
GITHUB_URL="https://raw.githubusercontent.com/mbecker20/komodo/main/compose/${COMPOSE_FILE}"
wget -q -O "/opt/komodo/${COMPOSE_FILE}" "$GITHUB_URL" || {
msg_error "Failed to download ${COMPOSE_FILE} from GitHub!"
mv "/opt/komodo/${BACKUP_FILE}" "/opt/komodo/${COMPOSE_FILE}"
exit 1
}