Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fetches the latest Vivaldi Linux rpm or deb package listed on the team blog
#!/bin/sh
case ${ARCH:-$(uname -m)} in
x86_64) DEBARCH=amd64; ARCH=x86_64 ;;
i?86) DEBARCH=i386; ARCH=i386 ;;
*) echo "Your architecture is not supported!" >&2; exit 1 ;;
esac
if [ "$1" = "-d" ]; then
PKGTYPE=deb
ARCH=$DEBARCH
shift 1
elif [ "$1" = "-r" ]; then
PKGTYPE=rpm
shift 1
else
if [ -x "/usr/bin/dpkg" ]; then
PKGTYPE=deb
ARCH=$DEBARCH
else
PKGTYPE=rpm
fi
fi
for PKG in $(curl -Ls 'https://vivaldi.net/blogs/teamblog?format=feed&type=rss' | sed -n "s/.*\/snapshot\/\(vivaldi-snapshot[_-]\(\([0-9]\+\.\)\)\{3\}[0-9]\+[_-][0-9]\+[_\.]$ARCH.$PKGTYPE\).*/\1/p" | head -n ${1:-1}); do
if [ -e "$PKG" ]; then
echo "$PKG is the latest version and it is already present" >&2
else
echo "Fetching $PKG"
curl -O "https://downloads.vivaldi.com/snapshot/$PKG"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.