Last active
October 11, 2017 07:31
-
-
Save ma4a/00a479046314791a89430a05f7e9a0e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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