forked from openwpm/OpenWPM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-system.sh
executable file
·73 lines (65 loc) · 2.36 KB
/
install-system.sh
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
set -e
if [[ $# -gt 1 ]]; then
echo "Usage: install.sh [--flash | --no-flash]" >&2
exit 1
fi
if [[ $# -gt 0 ]]; then
case "$1" in
"--flash")
flash=true
;;
"--no-flash")
flash=false
;;
*)
echo "Usage: install.sh [--flash | --no-flash]" >&2
exit 1
;;
esac
else
echo "Would you like to install Adobe Flash Player? (Only required for crawls with Flash) [y,N]"
read -s -n 1 response
if [[ $response = "" ]] || [ $response == 'n' ] || [ $response == 'N' ]; then
flash=false
echo Not installing Adobe Flash Plugin
elif [ $response == 'y' ] || [ $response == 'Y' ]; then
flash=true
echo Installing Adobe Flash Plugin
else
echo Unrecognized response, exiting
exit 1
fi
fi
if [ "$flash" = true ]; then
sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
fi
sudo apt-get update
sudo apt-get install -y firefox htop git python-dev libxml2-dev libxslt-dev libffi-dev libssl-dev build-essential libboost-python-dev libleveldb-dev libjpeg-dev curl wget git bash vim
# For some versions of ubuntu, the package libleveldb1v5 isn't available. Use libleveldb1 instead.
sudo apt-get install -y libleveldb1v5 || sudo apt-get install -y libleveldb1
if [ "$flash" = true ]; then
sudo apt-get install -y adobe-flashplugin
fi
# Use the Unbranded build that corresponds to Firefox 68 release (source: https://wiki.mozilla.org/Add-ons/Extension_Signing#Unbranded_Builds)
wget https://queue.taskcluster.net/v1/task/HYGMEM_UT06yMsOpWtHyVQ/runs/0/artifacts/public/build/target.tar.bz2
tar jxf target.tar.bz2
rm -rf firefox-bin
mv firefox firefox-bin
rm target.tar.bz2
# Selenium 3.3+ requires a 'geckodriver' helper executable, which is not yet
# packaged.
GECKODRIVER_VERSION=0.24.0
case $(uname -m) in
(x86_64)
GECKODRIVER_ARCH=linux64
;;
(*)
echo Platform $(uname -m) not known to be supported by geckodriver >&2
exit 1
;;
esac
wget https://github.com/mozilla/geckodriver/releases/download/v${GECKODRIVER_VERSION}/geckodriver-v${GECKODRIVER_VERSION}-${GECKODRIVER_ARCH}.tar.gz
tar zxf geckodriver-v${GECKODRIVER_VERSION}-${GECKODRIVER_ARCH}.tar.gz
rm geckodriver-v${GECKODRIVER_VERSION}-${GECKODRIVER_ARCH}.tar.gz
mv geckodriver firefox-bin