Skip to content

Commit 2fc8647

Browse files
committed
Fix install script in relation to availability of Xenial package
The commit fix issue #340
1 parent 9cfc273 commit 2fc8647

File tree

1 file changed

+35
-21
lines changed

1 file changed

+35
-21
lines changed

scripts/install.sh

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ if [ ! $(id -u) = 0 ]; then
77
fi
88

99
LOGFILE="./install.log"
10+
ASSUMEYES=0
11+
12+
for arg in "$@"; do
13+
shift
14+
case "$arg" in
15+
--assume-yes ) ASSUMEYES=1; shift;;
16+
-- ) shift; break;;
17+
* ) break;;
18+
esac
19+
done
1020

1121
DISTRO="unknown"
1222
DISTRO_CODENAME="unknown"
@@ -15,32 +25,36 @@ if which lsb_release >/dev/null; then
1525
DISTRO_CODENAME="$( lsb_release -cs )"
1626
fi
1727

18-
if [ $DISTRO_CODENAME != "trusty" ]; then
19-
echo "!!!!!!!!!!!! WARNING !!!!!!!!!!!!"
20-
echo "You are attempting to install Tor2web on an unsupported platform."
21-
echo "Supported platform is Ubuntu Trusty (14.04)"
22-
23-
while true; do
24-
read -p "Do you wish to continue anyhow? [y|n]?" yn
25-
case $yn in
26-
[Yy]*) break;;
27-
[Nn]*) echo "Installation aborted."; exit;;
28-
*) echo $yn; echo "Please answer y/n."; continue;;
29-
esac
30-
done
28+
if echo "$DISTRO_CODENAME" | grep -vqE "^xenial$" ; then
29+
echo "WARNING: GlobaLeaks is supported and tested only on Ubuntu Xenial (16.04)"
30+
31+
if [ $ASSUMEYES -eq 0 ]; then
32+
while true; do
33+
read -p "Do you wish to continue anyway? [y|n]?" yn
34+
case $yn in
35+
[Yy]*) break;;
36+
[Nn]*) exit 1;;
37+
*) echo $yn; echo "Please answer y/n."; continue;;
38+
esac
39+
done
40+
fi
3141
fi
3242

3343
echo "Performing Tor2web installation on $DISTRO - $DISTRO_CODENAME"
3444

35-
if [ $DISTRO_CODENAME != "trusty" ]; then
36-
# In case of unsupported platforms we fallback on trusty
37-
echo "Given that the platform is not supported the install script will use trusty repository."
38-
echo "In case of failure refer to the wiki for manual setup possibilities."
39-
echo "Tor2web Wiki Address: https://github.com/globaleaks/Tor2web/wiki"
40-
41-
# Given the fact that the platform is not supported be try as it is an Ubuntu 14.04
45+
# The supported platforms are experimentally more than only Ubuntu as
46+
# publicly communicated to users.
47+
#
48+
# Depending on the intention of the user to proceed anyhow installing on
49+
# a not supported distro we using the experimental package if it exists
50+
# or xenial as fallback.
51+
if echo "$DISTRO_CODENAME" | grep -vqE "^(trusty|xenial|wheezy|jessie)$"; then
52+
# In case of unsupported platforms we fallback on Xenial
53+
echo "No packages available for the current distribution; the install script will use the Xenial repository."
54+
echo "In case of a failure refer to the wiki for manual setup possibilities."
55+
echo "GlobaLeaks wiki: https://github.com/globaleaks/GlobaLeaks/wiki"
4256
DISTRO="Ubuntu"
43-
DISTRO_CODENAME="trusty"
57+
DISTRO_CODENAME="xenial"
4458
fi
4559

4660
DO () {

0 commit comments

Comments
 (0)