@@ -6,9 +6,123 @@ if [ ! $(id -u) = 0 ]; then
6
6
exit 1
7
7
fi
8
8
9
+ # Preliminary Requirements Check
10
+ ERR=0
11
+ echo " Checking preliminary Tor2web requirements"
12
+ for REQ in apt-key apt-get
13
+ do
14
+ if which $REQ > /dev/null; then
15
+ echo " + $REQ requirement meet"
16
+ else
17
+ ERR=$(( $ERR + 1 ))
18
+ echo " - $REQ requirement not meet"
19
+ fi
20
+ done
21
+
22
+ if [ $ERR -ne 0 ]; then
23
+ echo " Error: Found ${ERR} unmet requirements"
24
+ exit 1
25
+ fi
26
+
27
+ DO () {
28
+ if [ -z " $2 " ]; then
29
+ EXPECTED_RET=0
30
+ else
31
+ EXPECTED_RET=$2
32
+ fi
33
+ if [ -z " $3 " ]; then
34
+ CMD=$1
35
+ else
36
+ CMD=$3
37
+ fi
38
+ echo -n " Running: \" $CMD \" ... "
39
+ eval $CMD & > ${LOGFILE}
40
+
41
+ STATUS=$?
42
+
43
+ echo $CMD > $TMPDIR /last_command
44
+ echo $STATUS > $TMPDIR /last_status
45
+
46
+ if [ " $STATUS " -eq " $EXPECTED_RET " ]; then
47
+ echo " SUCCESS"
48
+ else
49
+ echo " FAIL"
50
+ echo " Ouch! The installation failed."
51
+ echo " COMBINED STDOUT/STDERR OUTPUT OF FAILED COMMAND:"
52
+ cat ${LOGFILE}
53
+ exit 1
54
+ fi
55
+ }
56
+
9
57
LOGFILE=" ./install.log"
10
58
ASSUMEYES=0
11
59
60
+ GLOBALEAKS_PGP_KEY="
61
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
62
+ Version: GnuPG v1
63
+
64
+ mQINBFFtX2EBEADWMQ9CpB55LcQzg1JS2oCzOcHN3oWQwfluIJltFPzbUC8KSTJr
65
+ rSKghSIzgA9C5ltoFgqwhZCiwQX0sFHLHw0+WQLXDqyRcJWCmL1GVIvAN1xW5aPA
66
+ jvZ14TJJiajYF+q0v2Lm8JCtD4hk1QcpJE+IOiSMMDqu9nM9ic8+xJZKYY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WwSJSSgUy6sGbWzuyS6I4LhGLI4JUVIK5fZqO0
114
+ KVwRt0t0blrj3raMw96+DLKPCTA9KhCoquqLcqVdWaTDgSL/6M3UzjxPuTCJwrcO
115
+ wNwh0apdUHRLuv6dT+jzmxKd86mFQ5+1vEO4JBrpX2eypeBO8ZT9sk91j/sNHDBo
116
+ MuRVXLaegSbS6573eMRDlUFK/G+K70B5RSYCe2ar6JQexJcSakqjjb9cWkiIjfPT
117
+ 4ihaZNSYoSIuoqlkuXttrVj0ZztuItphCSH4nnN7Rffzey/fbv6iUmjO4xnf5rAo
118
+ D9GUxcz4tF6dL5LX7UMVU2/RNELGSFrUmVUVg6Z2l6je6m0oGZfIK2KFtkna8dGC
119
+ 8j6syVJkUIJUTrmZETYdTw122Hg7rJJrf4FaFgfgZi1U6b0lJTBgQGZ+VUXR49MG
120
+ NshNOQa+Ub+kyMsitQDWqzh2TR8sJyYaMwv/rz3Cm1njwcU/8NDWMY4v5jUISFqR
121
+ OcCSx6XDEyEV4rKeLsxUyBniKjrc+1/zTmW5SNxwWYhCZRqzfo3WXzf5r9kceduQ
122
+ OisT5J7VDAueCSvTM1R7YtjATgKfSdf1UiR76lDnZjsE
123
+ =XU7T
124
+ -----END PGP PUBLIC KEY BLOCK-----"
125
+
12
126
for arg in " $@ " ; do
13
127
shift
14
128
case " $arg " in
21
135
DISTRO=" unknown"
22
136
DISTRO_CODENAME=" unknown"
23
137
if which lsb_release > /dev/null; then
24
- DISTRO=" $( lsb_release -is ) "
25
- DISTRO_CODENAME=" $( lsb_release -cs ) "
138
+ DISTRO=" $( lsb_release -is) "
139
+ DISTRO_CODENAME=" $( lsb_release -cs) "
140
+ REAL_DISTRO=$DISTRO
141
+ REAL_DISTRO_CODENAME=$DISTRO_CODENAME
142
+ fi
143
+
144
+ # LinuxMint is based on Ubuntu, if we encounter Mint just allign the Ubuntu version is based upon
145
+ if [ " $DISTRO " == " LinuxMint" ]; then
146
+ DISTRO=" Ubuntu"
147
+ DISTRO_CODENAME=$( grep UBUNTU_CODENAME /etc/os-release | sed -e ' s/UBUNTU_CODENAME=//' )
26
148
fi
27
149
28
150
if echo " $DISTRO_CODENAME " | grep -vqE " ^xenial$" ; then
@@ -40,7 +162,7 @@ if echo "$DISTRO_CODENAME" | grep -vqE "^xenial$" ; then
40
162
fi
41
163
fi
42
164
43
- echo " Performing Tor2web installation on $DISTRO - $DISTRO_CODENAME "
165
+ echo " Detected OS: $DISTRO - $DISTRO_CODENAME "
44
166
45
167
# The supported platforms are experimentally more than only Ubuntu as
46
168
# publicly communicated to users.
@@ -57,50 +179,9 @@ if echo "$DISTRO_CODENAME" | grep -vqE "^(trusty|xenial|wheezy|jessie)$"; then
57
179
DISTRO_CODENAME=" xenial"
58
180
fi
59
181
60
- DO () {
61
- if [ -z " $2 " ]; then
62
- RET=0
63
- else
64
- RET=$2
65
- fi
66
- if [ -z " $3 " ]; then
67
- CMD=$1
68
- else
69
- CMD=$3
70
- fi
71
- echo -n " Running: \" $CMD \" ... "
72
- eval $CMD & > ${LOGFILE}
73
- if [ " $? " -eq " $RET " ]; then
74
- echo " SUCCESS"
75
- else
76
- echo " FAIL"
77
- echo " COMBINED STDOUT/STDERR OUTPUT OF FAILED COMMAND:"
78
- cat ${LOGFILE}
79
- exit 1
80
- fi
81
- }
82
-
83
- # Preliminary Requirements Check
84
- ERR=0
85
- echo " Checking preliminary Tor2web requirements"
86
- for REQ in apt-key apt-get wget
87
- do
88
- if which $REQ > /dev/null; then
89
- echo " + $REQ requirement meet"
90
- else
91
- ERR=$(( $ERR + 1 ))
92
- echo " - $REQ requirement not meet"
93
- fi
94
- done
95
-
96
- if [ $ERR -ne 0 ]; then
97
- echo " Error: Found ${ERR} unmet requirements"
98
- exit 1
99
- fi
100
-
101
182
echo " Adding GlobaLeaks PGP key to trusted APT keys"
102
- TMPFILE=/tmp/ globaleaks_key. $RANDOM
103
- DO " wget https://deb.globaleaks.org/globaleaks.asc -O $TMPFILE "
183
+ TMPFILE=$TMPDIR / globaleaks_key
184
+ echo " $GLOBALEAKS_PGP_KEY " > $TMPFILE
104
185
DO " apt-key add $TMPFILE "
105
186
DO " rm -f $TMPFILE "
106
187
@@ -114,9 +195,12 @@ else
114
195
DO " apt-get install software-properties-common -y"
115
196
fi
116
197
117
- if ! grep -q " ^deb .*universe" /etc/apt/sources.list /etc/apt/sources.list.d/* ; then
118
- echo " Adding Ubuntu Universe repository"
119
- DO " add-apt-repository 'deb http://archive.ubuntu.com/ubuntu $( lsb_release -sc) universe'"
198
+ # try adding universe repo only on Ubuntu
199
+ if echo " $DISTRO " | grep -qE " ^(Ubuntu)$" ; then
200
+ if ! grep -q " ^deb .*universe" /etc/apt/sources.list /etc/apt/sources.list.d/* ; then
201
+ echo " Adding Ubuntu Universe repository"
202
+ DO " add-apt-repository 'deb http://archive.ubuntu.com/ubuntu $DISTRO_CODENAME universe'"
203
+ fi
120
204
fi
121
205
122
206
if [ ! -f /etc/apt/sources.list.d/globaleaks.list ]; then
0 commit comments