#!/usr/bin/env bash
PREFIX=/tmp
USER=pyload
PROJECT=pyload
RELEASE=$(curl -s https://api.github.com/repos/${USER}/${PROJECT}/releases/latest | grep tarball_url | cut -d '"' -f 4 | awk -F "/" {'print $8'})

RSS_FEED="https://github.com/${USER}/${PROJECT}/releases.atom"
# xdg-open ${RSS_FEED}
echo ${RSS_FEED}

wget -c -P ${PREFIX} http://github.com/${USER}/${PROJECT}/releases/download/${RELEASE}/${USER}_${RELEASE}_amd64.deb

dpkg -i ${PREFIX}/${USER}_${RELEASE}_amd64.deb
apt install -f
