Skip to content
This repository has been archived by the owner on May 7, 2019. It is now read-only.

Unburden zotero's servers in case #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions zotero_installer.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Zotero installer
# Copyright 2011-2013 Sebastiaan Mathot
# Copyright 2011-2018 Sebastiaan Mathot
# <http://www.cogsci.nl/>
#
# This file is part of qnotero.
Expand All @@ -22,8 +22,10 @@
VERSION="5.0.48"
if [ `uname -m` == "x86_64" ]; then
ARCH="x86_64"
VERSION_SHA256_HASH=7cb871894f1de168c0e486d2d48fc8524d23453198a2b834c23d958abd63443d
else
ARCH="i686"
VERSION_SHA256_HASH=24f66641bc0bebc9e7e1414bdb03050e6fde7d6939307b17afc3d1f349d5646d
fi
TMP="/tmp/zotero.tar.bz2"
DEST_FOLDER=zotero
Expand Down Expand Up @@ -74,12 +76,20 @@ URL="https://download.zotero.org/client/release/${VERSION}/Zotero-${VERSION}_lin
echo ">>> Downloading Zotero standalone $VERSION for $ARCH"
echo ">>> URL: $URL"

wget $URL -O $TMP
[[ ! -f $TMP ]] && wget $URL -O $TMP
if [ $? -ne 0 ]; then
echo ">>> Failed to download Zotero"
echo ">>> Aborting installation, sorry!"
exit 1
fi
# Check integrity

NEW_HASH=$(sha256sum $TMP | awk '{print $1}')
if [ $VERSION_SHA256_HASH != $NEW_HASH ]; then
echo ">>> Zotero download file corrupted"
echo ">>> Aborting installation, sorry!"
exit 1
fi

if [ -d $DEST/$DEST_FOLDER ]; then
echo ">>> The destination folder ($DEST/$DEST_FOLDER) exists. Do you want to remove it?"
Expand Down