-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·66 lines (52 loc) · 1.16 KB
/
build.sh
File metadata and controls
executable file
·66 lines (52 loc) · 1.16 KB
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
#!/bin/bash
echo "Checking parameters"
if [ $# -eq 2 ]
then
echo "ok"
else
echo "Missing arguments"
exit 1
fi
if ! lsof -i:8888
then
echo "8888 is free"
else
echo "8888 is occupied"
exit 1
fi
echo "Installing dependencies"
apt-get install automake
apt-get install build-essential
echo "Cloning tinyproxy"
sudo git clone https://github.com/tinyproxy/tinyproxy
cd tinyproxy/
echo "ok"
echo "Compiling"
./autogen.sh
make
make install
cd ..
echo "ok"
echo "Adding tinyproxy user"
useradd -M -U -s /bin/false tinyproxy
echo "ok"
echo "Adding aux files"
mkdir -p /usr/local/var/log/tinyproxy
touch /usr/local/var/log/tinyproxy/tinyproxy.log
chown tinyproxy:root /usr/local/var/log/tinyproxy/tinyproxy.log
echo "ok"
username=$1
password=$2
echo "Adding conf file"
cp ./tinyproxy.conf.template ./tinyproxy.conf
echo "BasicAuth $username $password" >> ./tinyproxy.conf
mv ./tinyproxy.conf /usr/local/etc/tinyproxy/tinyproxy.conf
echo "ok"
echo "Creating service"
cp ./tinyproxy.service /etc/systemd/system/tinyproxy.service
systemctl daemon-reload
echo "ok"
echo "Starting service"
systemctl start tinyproxy
systemctl enable tinyproxy.service
echo "done"