Skip to content

Commit 54fc44a

Browse files
author
Invers3
committed
Create updater.sh
testing
1 parent 42994d7 commit 54fc44a

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

files/updater.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/sh
2+
3+
"$(opkg remove rp-pppoe-server && rp-pppoe-common)"
4+
5+
if [ -f /etc/init.d/pppoe-server ]; then
6+
rm /etc/init.d/pppoe-server
7+
fi
8+
if [ -f /etc/config/pppoe ]; then
9+
rm /etc/config/pppoe
10+
fi
11+
if [ -f /etc/ppp/chap-secrets ]; then
12+
rm /etc/ppp/chap-secrets
13+
fi
14+
if [ -f /etc/ppp/pap-secrets ]; then
15+
rm /etc/ppp/pap-secrets
16+
fi
17+
if [ -f /etc/ppp/pppoe-server-options ]; then
18+
rm /etc/ppp/pppoe-server-options
19+
fi
20+
21+
rm -f /usr/sbin/pppwn /etc/init.d/pw /etc/config/pw && rm -rf /root/*
22+
23+
if [ -d /www/pppwn ]; then
24+
rm -rf /www/pppwn
25+
fi
26+
if [ -f /www/pppwn.html ]; then
27+
rm -f /www/pppwn.html
28+
fi
29+
if [ -f /www/cgi-bin/pw.cgi ]; then
30+
rm -f /www/cgi-bin/pw.cgi
31+
fi
32+
33+
"$(opkg update && opkg install rp-pppoe-common rp-pppoe-server)"
34+
wait
35+
36+
mkdir /tmp/PPPwn_ow /www/pppwn
37+
"$(wget -O /tmp/pw.tar https://raw.githubusercontent.com/CodeInvers3/codeinvers3.github.io/refs/heads/master/files/PPPwn_ow.tar &)"
38+
wait
39+
40+
"$(tar -xvf /tmp/pw.tar -C /tmp/PPPwn_ow && rm /tmp/pw.tar)"
41+
mv -f /tmp/PPPwn_ow/etc/config/* /etc/config
42+
mv -f /tmp/PPPwn_ow/etc/init.d/* /etc/init.d
43+
mv -f /tmp/PPPwn_ow/etc/ppp/* /etc/ppp
44+
mv -f /tmp/PPPwn_ow/stage1 /root
45+
mv -f /tmp/PPPwn_ow/stage2 /root
46+
mv -f /tmp/PPPwn_ow/version /root
47+
mv -f /tmp/PPPwn_ow/www/* /www/pppwn
48+
rm -r /tmp/PPPwn_ow
49+
chmod +x /etc/init.d/pw /etc/init.d/pppoe-server /www/pppwn/cgi-bin/pw.cgi
50+
51+
uci set uhttpd.pppwn=uhttpd
52+
uci set uhttpd.pppwn.listen_http='81'
53+
uci set uhttpd.pppwn.home='/www/pppwn'
54+
uci set uhttpd.pppwn.cgi_prefix='/cgi-bin'
55+
uci set uhttpd.pppwn.script_timeout='90'
56+
uci set uhttpd.pppwn.network_timeout='60'
57+
uci set uhttpd.pppwn.tcp_keepalive='1'
58+
uci add_list uhttpd.pppwn.interpreter='.sh=/bin/sh'
59+
uci add_list uhttpd.pppwn.interpreter='.cgi=/bin/sh'
60+
uci commit uhttpd
61+
62+
/etc/init.d/uhttpd restart
63+
/etc/init.d/pppoe-server enable
64+
/etc/init.d/pppoe-server start

0 commit comments

Comments
 (0)