Update on how to get the Vaultwarden version

This commit is contained in:
adrien 2021-08-03 10:37:22 +02:00
parent eb4fe9de6d
commit 15ce3e0bee
Signed by: adrien
GPG Key ID: 4F17BEA67707AC21

View File

@ -60,10 +60,10 @@ function update_vaultwarden {
} }
# retrieve local release # retrieve local release
local_release=$(/usr/local/bin/vaultwarden --version | awk --field-separator '-' '{print $2}') local_release=$(/usr/local/bin/vaultwarden --version | awk --field-separator ' ' '{print $2}')
# retrieve the latest release # retrieve the latest release
latest_release=$(git ls-remote https://github.com/dani-garcia/vaultwarden.git HEAD | awk '{print substr($1, 1, length($1) - 32)}') latest_release=$(/usr/bin/curl --silent "https://api.github.com/repos/dani-garcia/vaultwarden/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
# compare these two versions # compare these two versions
if [ ${latest_release} == ${local_release} ] if [ ${latest_release} == ${local_release} ]