Created
April 12, 2016 12:04
-
-
Save ma4a/c0fbc92547284f337bbb9d1ccc7b16ae 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 | |
| #options; change if needed :) | |
| tmpdir='/tmp/' #trailing slash needed | |
| #don't change things below. | |
| seafile_filename_regex='(seafile_[0-9.]{1,11}_'$platform'.deb)' | |
| seafile_latest_version='' | |
| seafile_deb=$tmpdir'seafile_latest.deb' | |
| #check for x64 | |
| if [[ `uname -a` =~ .*_64.* ]] | |
| then | |
| platform="amd64"; | |
| else | |
| platform="i386"; | |
| fi | |
| #search for latest version | |
| seafile_latest_version=$(curl -s "https://dl.bintray.com/seafile-org/seafile/" | sort -r | grep -oP '(seafile_[0-9.]{1,11}_amd64.deb)'|head -n1) | |
| echo "Latest version: $seafile_latest_version" | |
| #download latest version | |
| echo "Starting download... please wait..." | |
| wget -qO $seafile_deb https://bintray.com/artifact/download/seafile-org/seafile/$seafile_latest_version | |
| if [[ -f $seafile_deb ]] | |
| then | |
| #install package | |
| echo "Starting installation..." | |
| sudo dpkg -i $seafile_deb >/dev/null; | |
| else | |
| echo "an error occured. the download may have failed."; | |
| fi | |
| seafile-applet & | |
| echo "Update finished. Test it, be happy." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment