2
2
3
3
# user permission check
4
4
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
7
7
fi
8
8
9
9
LOGFILE=" ./install.log"
@@ -55,21 +55,21 @@ DO () {
55
55
CMD=$3
56
56
fi
57
57
echo -n " Running: \" $CMD \" ... "
58
- $CMD & > ${LOGFILE}
58
+ eval $CMD & > ${LOGFILE}
59
59
if [ " $? " -eq " $RET " ]; then
60
60
echo " SUCCESS"
61
61
else
62
62
echo " FAIL"
63
63
echo " COMBINED STDOUT/STDERR OUTPUT OF FAILED COMMAND:"
64
- cat ${FILE }
64
+ cat ${LOGFILE }
65
65
exit 1
66
66
fi
67
67
}
68
68
69
69
# Preliminary Requirements Check
70
70
ERR=0
71
71
echo " Checking preliminary Tor2web requirements"
72
- for REQ in apt-key apt-get
72
+ for REQ in apt-key apt-get wget
73
73
do
74
74
if which $REQ > /dev/null; then
75
75
echo " + $REQ requirement meet"
@@ -92,20 +92,17 @@ DO "rm -f $TMPFILE"
92
92
93
93
DO " apt-get update -y"
94
94
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
106
102
103
+ if ! grep -q " ^deb .*universe" /etc/apt/sources.list /etc/apt/sources.list.d/* ; then
107
104
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' "
109
106
fi
110
107
111
108
if [ ! -f /etc/apt/sources.list.d/globaleaks.list ]; then
@@ -114,5 +111,4 @@ if [ ! -f /etc/apt/sources.list.d/globaleaks.list ]; then
114
111
fi
115
112
116
113
DO " apt-get update -y"
117
-
118
114
DO " apt-get install tor2web -y"
0 commit comments