Skip to content

Commit b2c96f9

Browse files
committed
Apply updates to install script following GlobaLeaks changes
1 parent 5d92c65 commit b2c96f9

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

scripts/install.sh

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# user permission check
44
if [ ! $(id -u) = 0 ]; then
5-
echo "Error: Tor2web install script must be runned by root"
6-
exit 1
5+
echo "Error: Tor2web install script must be runned by root"
6+
exit 1
77
fi
88

99
LOGFILE="./install.log"
@@ -55,21 +55,21 @@ DO () {
5555
CMD=$3
5656
fi
5757
echo -n "Running: \"$CMD\"... "
58-
$CMD &>${LOGFILE}
58+
eval $CMD &>${LOGFILE}
5959
if [ "$?" -eq "$RET" ]; then
6060
echo "SUCCESS"
6161
else
6262
echo "FAIL"
6363
echo "COMBINED STDOUT/STDERR OUTPUT OF FAILED COMMAND:"
64-
cat ${FILE}
64+
cat ${LOGFILE}
6565
exit 1
6666
fi
6767
}
6868

6969
# Preliminary Requirements Check
7070
ERR=0
7171
echo "Checking preliminary Tor2web requirements"
72-
for REQ in apt-key apt-get
72+
for REQ in apt-key apt-get wget
7373
do
7474
if which $REQ >/dev/null; then
7575
echo " + $REQ requirement meet"
@@ -92,20 +92,17 @@ DO "rm -f $TMPFILE"
9292

9393
DO "apt-get update -y"
9494

95-
# on Ubuntu python-pip requires universe repository
96-
if [ $DISTRO == "Ubuntu" ];then
97-
if [ "$DISTRO_CODENAME" = "precise" ]; then
98-
echo "Installing python-software-properties"
99-
DO "apt-get install python-software-properties -y"
100-
fi
101-
102-
if [ "$DISTRO_CODENAME" = "trusty" ]; then
103-
echo "Installing software-properties-common"
104-
DO "apt-get install software-properties-common -y"
105-
fi
95+
if echo "$DISTRO_CODENAME" | grep -qE "^(wheezy)$"; then
96+
echo "Installing python-software-properties"
97+
DO "apt-get install python-software-properties -y"
98+
else
99+
echo "Installing software-properties-common"
100+
DO "apt-get install software-properties-common -y"
101+
fi
106102

103+
if ! grep -q "^deb .*universe" /etc/apt/sources.list /etc/apt/sources.list.d/*; then
107104
echo "Adding Ubuntu Universe repository"
108-
add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
105+
DO "add-apt-repository 'deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe'"
109106
fi
110107

111108
if [ ! -f /etc/apt/sources.list.d/globaleaks.list ]; then
@@ -114,5 +111,4 @@ if [ ! -f /etc/apt/sources.list.d/globaleaks.list ]; then
114111
fi
115112

116113
DO "apt-get update -y"
117-
118114
DO "apt-get install tor2web -y"

0 commit comments

Comments
 (0)