Skip to content

Commit 2d1e8cf

Browse files
author
zhiwei.meng
committed
add hostapd control
1 parent 92be8c3 commit 2d1e8cf

11 files changed

+66
-6
lines changed

cfg/cid_store.dat

577 Bytes
Binary file not shown.

cfg/dht.cfg

0 Bytes
Binary file not shown.

cfg/download.cfg

+5-5
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,13 @@ upload_manager.max_files=5
197197
upload_manager.max_idle_interval=2000
198198
upload_manager.max_unchoke_pipes=5
199199
upload_manager.max_choke_pipes=50
200-
upload_stat.begin_time=1476363600
201-
upload_stat.end_time=1476414000
202-
upload_stat.up_duration=50400
200+
upload_stat.begin_time=1476723600
201+
upload_stat.end_time=1476792000
202+
upload_stat.up_duration=68400
203203
upload_stat.up_use_duration=0
204-
upload_stat.up_pipe_num=0
204+
upload_stat.up_pipe_num=353
205205
upload_stat.up_passive_pipe_num=0
206-
upload_stat.up_data_bytes=0
206+
upload_stat.up_data_bytes=331787708
207207
upload_manager_box.enable_upload=1
208208
upload_manager_box.enable_upload_when_download=0
209209
upload_manager_box.up_speed_limit_max=40

cfg/etm.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ system.vod_buffer_size=0
1515
system.vod_buffer_time=0
1616
vip_level=0
1717
userid=91106333
18-
jumpkey=6D531D972902D5EA18887E94CB672C85C132596D0327368069AA2131EC14D54CF1B2A2B66FEC163093852D76A38C4BEC2EEBD951F4D8AD0451942D2DEF31EA0553C7D768ED0DBB55B9E0BA4B1FF9189B5601B7C661FE3688BEFC54D5BE827ABC
18+
jumpkey=9DAAEED9B34F33C21EE27A16AFC256DEE4597020CC7A299C528C8FD700F3494AE843EE59B92E71F9943866BE4900331CA02ACC7063F253F6E302471FED7FA687124C4A5706E16628D163DD26B13E379187088D5CFA64E6B0F0A49691D664E4F3
1919
system.auto_open_lixian=1
2020
high_speed_channel.query_server_addr=viphub5pr.phub.sandai.net
2121
high_speed_channel.query_server_port=80

cronjob/root

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#0 4 * * 0 (sleep 65;touch /etc/banner;ifdown wan;reboot)
1111
#*/5 * * * * log -t mmxcron "abcd"
1212
*/5 * * * * /data/mmx/xunlei/check-xunlei.sh
13+
*/5 * * * * /data/mmx/hostapd/chk-hostapd.sh
1314
*/2 * * * * /data/mmx/set-ddns.sh
1415
*/2 * * * * /data/mmx/chk-pppd.sh
1516

force-on-hostapd.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/system/bin/sh
2+
setprop mmx.hostapd.forceon 1
3+
/data/mmx/hostapd/chk-hostapd.sh

hostapd/chk-hostapd.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/system/bin/sh
2+
on=0
3+
enable=`getprop mmx.hostapd.forceon`
4+
if [ a"$enable" == a1 ]; then
5+
on=1
6+
else
7+
on=`/data/mmx/hostapd/time-on-checking.sh`
8+
fi
9+
10+
11+
pslist=`ps`
12+
cnt=`echo $pslist | grep /system/bin/hostapd | wc -l`
13+
#echo $cnt $on
14+
if [[ $cnt -eq 0 && $on -eq 1 ]]; then
15+
log -t mmx-check-hostapd "turn on WIFI ap"
16+
/data/mmx/hostapd/en-hostapd.sh
17+
elif [[ $cnt -ne 0 && $on -ne 1 ]]; then
18+
log -t mmx-check-hostapd "turn off WIFI ap"
19+
/data/mmx/hostapd/off-hostapd.sh
20+
fi
21+

hostapd/en-hostapd.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/system/bin/sh
2+
service call wifi 34 i32 0 i32 1

hostapd/off-hostapd.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/system/bin/sh
2+
service call wifi 34 i32 0 i32 0

hostapd/time-on-checking.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/system/bin/sh
2+
on=0
3+
n=`date +'%s'`
4+
d=`expr $n + 28800`
5+
#echo $d
6+
dow=`date -d @$d -u +'%w'`
7+
h=`date -d @$d -u +'%k'`
8+
#echo $dow $hour
9+
10+
case $dow in
11+
0) #Sunday
12+
if [[ $h -ge 19 ]]; then
13+
on=1
14+
fi
15+
;;
16+
[1-4]) #Monday to thurthday
17+
if [[ $h -ge 7 && $h -lt 10 || $h -ge 19 ]]; then
18+
on=1
19+
fi
20+
;;
21+
5) #Friday
22+
if [[ $h -ge 7 && $h -lt 10 ]]; then
23+
on=1
24+
fi
25+
;;
26+
esac
27+
echo $on
28+

time-schedule-hostapd.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/system/bin/sh
2+
setprop mmx.hostapd.forceon 0
3+
/data/mmx/hostapd/chk-hostapd.sh

0 commit comments

Comments
 (0)