-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathinstaller.sh
More file actions
82 lines (70 loc) · 2.06 KB
/
Copy pathinstaller.sh
File metadata and controls
82 lines (70 loc) · 2.06 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/sh /etc/rc.common
if ! command -v pppoe-server >/dev/null 2>&1; then
opkg update
opkg install rp-pppoe-server
fi
if [ -f /tmp/main.zip ]; then
rm -r /tmp/main.zip
fi
if [ -d /root/offsets ]; then
rm -r /root/offsets
fi
if [ -d /root/stage1 ]; then
rm -r /root/stage1
fi
if [ -d /root/stage2 ]; then
rm -r /root/stage2
fi
if [ -d /www/pppwn ]; then
rm -r /www/pppwn
fi
if [ -f /root/pw.conf ]; then
rm /root/pw.conf
fi
if [ -f /root/version ]; then
rm /root/version
fi
if [ -f /root/run.sh ]; then
rm /root/run.sh
fi
if [ -f /www/pppwn.html ]; then
rm /www/pppwn.html
fi
if [ -f /www/cgi-bin/pw.cgi ]; then
rm /www/cgi-bin/pw.cgi
fi
wget -O /tmp/main.zip https://github.com/CodeInvers3/PPPwn_ow/archive/refs/heads/main.zip
unzip /tmp/main.zip -d /tmp
if [ -f /tmp/main.zip ]; then
rm /tmp/main.zip
fi
mv -f /tmp/PPPwn_ow-main/pppoe/ppp/pap-secrets /etc/ppp
mv -f /tmp/PPPwn_ow-main/pppoe/ppp/chap-secrets /etc/ppp
mv -f /tmp/PPPwn_ow-main/pppoe/ppp/pppoe-server-options /etc/ppp
mv -f /tmp/PPPwn_ow-main/pppoe/init.d/pppoe-server /etc/init.d
mv -f /tmp/PPPwn_ow-main/pppoe/config/pppoe /etc/config
mv -f /tmp/PPPwn_ow-main/www/pppwn /www
mv -f /tmp/PPPwn_ow-main/www/pppwn.html /www
mv -f /tmp/PPPwn_ow-main/www/cgi-bin/pw.cgi /www/cgi-bin
mv -f /tmp/PPPwn_ow-main/version /root/
mv -f /tmp/PPPwn_ow-main/pw.conf /root/
mv -f /tmp/PPPwn_ow-main/stage1 /root/
mv -f /tmp/PPPwn_ow-main/stage2 /root/
mv -f /tmp/PPPwn_ow-main/run.sh /root/
if [ -d /tmp/PPPwn_ow-main ]; then
rm -r /tmp/PPPwn_ow-main
fi
chmod +x /root/run.sh
chmod +x /www/cgi-bin/pw.cgi
chmod +x /etc/init.d/pppoe-server
if ! grep -q "list device 'ppp+'" /etc/config/firewall; then
sed -i "s/option name 'lan'/option name 'lan'\n\t list device 'ppp+'/" /etc/config/firewall
fi
if ! grep -q "/root/run.sh" /etc/rc.button/switch; then
sed -i "s/action=on/action=on\n\n\/root\/run\.sh/" /etc/rc.button/switch
fi
/etc/init.d/pppoe-server start
rm /tmp/installer.sh
echo "PPPwn web is hosted at http://192.168.8.1/pppwn.html"
echo "--- INSTALLATION COMPLETED! ---"
exit 0