-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinstall_smartdns.sh
More file actions
executable file
·37 lines (28 loc) · 1022 Bytes
/
install_smartdns.sh
File metadata and controls
executable file
·37 lines (28 loc) · 1022 Bytes
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
#!/bin/sh
set -e
filepath=$(cd "$(dirname "$0")"; pwd)
cd $filepath/../pkg
tar zxf virtualenv-1.9.1.tar.gz
tar zxf zope.interface-4.0.1.tar.gz
tar jxf Twisted-12.2.0.tar.bz2
cd virtualenv-1.9.1
python virtualenv.py $filepath/../../smartdns_env
. $filepath/../../smartdns_env/bin/activate
cd ../zope.interface-4.0.1
python setup.py install
cd ../Twisted-12.2.0
python setup.py install
cd .. && rm -rf virtualenv-1.9.1 zope.interface-4.0.1 Twisted-12.2.0
dnsfilenum=`find $filepath/../../smartdns_env/lib/python*/site-packages/Twisted-12.2.0*/twisted/names -name dns.py | wc -l`
if [ 1 -ne $dnsfilenum ]; then
echo "cannot find dns.py"
exit 2
fi
dnsfile=`find $filepath/../../smartdns_env/lib/python*/site-packages/Twisted-12.2.0*/twisted/names -name dns.py`
cp -f $filepath/dns_in_twisted.py $dnsfile
mkdir -p $filepath/../log
cp -rf $filepath/../rootfs/* /
sed -i "s#{smartdns_path}#${filepath}#g" /etc/systemd/system/smartdns.service
systemctl daemon-reload
systemctl enable smartdns
systemctl start smartdns