bin bash sudo pon ppp0 debug dump logfd nodetach ip ТВОЙ_VPS echo Ente

 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
#!/bin/bash
# sudo pon ppp0 debug dump logfd 2 nodetach
ip= ТВОЙ_VPS
echo "Enter username that you want to connect, e.g. Client1 or John:"
read u
echo "Specify password:"
read p
echo "Downloading and Installing PoPToP"
sudo aptitude update
sudo aptitude upgrade -y
sudo aptitude install -y pptpd
sudo aptitude install -y pptp-linux
echo "Connect to $ip ..."
# Adding user
echo "$u * $p *" > /etc/ppp/chap-secrets
sudo cat > /etc/ppp/options.pptp <<END
remotename pptp
pty "pptp $ip --nolaunchpppd"
noauth
user "$u"
password "$p"
nodeflate
nobsdcomp
require-mppe-128
proxyarp
persist
maxfail 5
holdoff 5
lcp-echo-interval 60
lcp-echo-failure 4
END
sudo cat > /etc/ppp/peers/ppp0 <<END
file /etc/ppp/options.pptp
END
sudo cat >> /etc/network/interfaces <<END
auto ppp0
iface ppp0 inet ppp
provider ppp0
route add -net 10.1.0.0/24 gw $ip
route add default dev eth0
END
echo "Restarting PoPToP"
/etc/init.d/pptpd restart
exit
fi