removing kopia

This commit is contained in:
tengel 2024-04-19 08:26:19 -05:00
parent 3732ade8dd
commit 438e675a06

View file

@ -32,29 +32,4 @@ function upgrade_rclone() {
fi
}
## kopia is not in repos
function upgrade_kopia() {
echo "Checking kopia..."
# get installed version
_LOCAL=$(dpkg-query --showformat='${Version}' --show kopia)
# get latest version, strip leading "v" (v1.55.1 -> 1.55.1)
_REMOTE=$(curl -s "https://api.github.com/repos/kopia/kopia/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
_REMOTE=${_REMOTE#v}
# bash doesn't see versions as numbers, but as strings
if [[ "${_LOCAL}" != "${_REMOTE}" ]]; then
echo "Upgrading kopia - installed ${_LOCAL}, latest ${_REMOTE}"
curl -L -o /tmp/kopia-latest.deb \
"https://github.com/kopia/kopia/releases/download/v${_REMOTE}/kopia_${_REMOTE}_linux_amd64.deb"
if [[ $? -eq 0 ]]; then
sudo apt-get install /tmp/kopia-latest.deb
rm -f /tmp/kopia-latest.deb
fi
else
echo "Installed kopia is the latest - ${_LOCAL}"
fi
}
upgrade_rclone
upgrade_kopia