aboutsummaryrefslogtreecommitdiff
path: root/share/hoarder/tor-browser-alpha/unix/linux/install
blob: a2e5dbd2bbc231ad86d8bef506dde2aaecc2841d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env sh
#
# Install Tor Browser Alpha
#

# Parameters
SHARE="$1"
LIB="$2"

# Include basic functions
. $LIB/trashman/functions || exit 1

# Requirements
trashman_require wget

# Additional parameters
APP="tor-browser-alpha"
VERSION="13.0a1"
URL="https://www.torproject.org/dist/torbrowser/${VERSION}/"
FILE="tor-browser-linux64-${VERSION}_ALL.tar.xz"
WORK="`mktemp -d`" || exit 1

# Download
wget "$URL/$FILE"     -O $WORK/$FILE     || exit 1
wget "$URL/$FILE.asc" -O $WORK/$FILE.asc || exit 1

# Verify
gpg --homedir $WORK/.gnupg --import $SHARE/$APP/unix/linux/files/$APP.asc || exit 1
gpg --homedir $WORK/.gnupg --verify $WORK/$FILE.asc                       || exit 1
rm -rf $WORK/.gnupg                                                       || exit 1

# Unpack
tar xvf $WORK/$FILE -C $WORK || exit 1

# Install
mkdir -p $HOME/.local/share || exit 1
cd $HOME/.local/share       || exit 1
rm -rf $APP                 || exit 1
mv $WORK/tor-browser $APP   || exit 1
rm -rf $WORK                || exit 1

# Create symlink to scripts
mkdir -p $HOME/.local/bin                                     || exit 1
cd $HOME/.local/bin                                           || exit 1
ln -sf $HOME/.local/share/$APP/Browser/start-tor-browser $APP || exit 1

# Done
trashman_installed_at $HOME/.local/share/$APP
trashman_run_with $HOME/.local/bin/$APP