Skip to content

Instantly share code, notes, and snippets.

@ma4a
Last active October 11, 2017 07:31
Show Gist options
  • Select an option

  • Save ma4a/00a479046314791a89430a05f7e9a0e6 to your computer and use it in GitHub Desktop.

Select an option

Save ma4a/00a479046314791a89430a05f7e9a0e6 to your computer and use it in GitHub Desktop.
#!/bin/bash
vivaldi_url=$(curl -s https://vivaldi.com/download/ | grep -oP '(https:\/\/[a-z0-9-.\/_]*_amd64.deb)')
vivaldi_filename=$(basename $vivaldi_url)
echo "current installed version: $(vivaldi --version)";
echo "available version: $vivaldi_filename";
read -p "Download the update? [y/N]" -n 1 -r;
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
wget "$vivaldi_url" -O "$vivaldi_filename";
read -p "Close current running Vivaldi and start updating process? [y/N]" -n 1 -r;
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
killall vivaldi-bin
sleep 3
sudo dpkg -i "$vivaldi_filename"
vivaldi-stable %U > /dev/null 2>&1 &
disown
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment