18 lines
496 B
Bash
Executable File
18 lines
496 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
. ./.env
|
|
|
|
DOCKER_API='https://hub.docker.com/v2/namespaces/searxng/repositories/searxng'
|
|
REPO='https://github.com/searxng/searxng'
|
|
|
|
tmp="$(mktemp)"
|
|
|
|
new_tag="$(curl -L "$DOCKER_API/tags" | jq -r '.results[2].name')"
|
|
new_commit="$(grep -Eo '\w+$' <<< "$new_tag")"
|
|
|
|
if curl -Lo "$tmp" "$REPO/raw/$new_commit/searx/settings.yml" && ! diff -Z "$tmp" "config/settings.yml" > /dev/null; then
|
|
$EDITOR -d -- "config/settings.yml" "$tmp"
|
|
fi
|
|
|
|
sed -i "/^IMAGEAPP=/s/:.*/:$new_tag/" .env
|