File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /system/bin/sh
2
+
3
+ MODPATH=" ${0%/* } "
4
+
5
+ get_active_iface () {
6
+ iface=$( ip route get 192.0.2.1 2> /dev/null | awk ' /dev/ {for(i=1;i<=NF;i++) if($i=="dev") print $(i+1)}' )
7
+ echo " $iface "
8
+ }
9
+
10
+ iface=$( get_active_iface)
11
+
12
+ new_mode=" none"
13
+ case " $iface " in
14
+ wlan* ) new_mode=" Wi-Fi" ;;
15
+ rmnet_data* ) new_mode=" Cellular" ;;
16
+ * ) new_mode=" none" ;;
17
+ esac
18
+
19
+ if [ " $new_mode " != " none" ]; then
20
+ echo " [+] Running Speed Test"
21
+ echo " [+] Internet Type: $new_mode "
22
+ echo " [+] Run 1: "
23
+ ${MODPATH} /bin/speedtest
24
+ echo " "
25
+ echo " [+] Run 2: "
26
+ ${MODPATH} /bin/speedtest
27
+ echo " "
28
+ echo " [+] Run 3: "
29
+ ${MODPATH} /bin/speedtest
30
+ else
31
+ echo " [-] No Active Internet Connection found!"
32
+ fi
Original file line number Diff line number Diff line change 59
59
60
60
# Always create rmnet_data_cubic unless another exists
61
61
create_file_if_needed " rmnet_data" " cubic"
62
+
63
+ chmod +x $MODPATH /bin/speedtest
64
+ chmod +x $MODPATH /action.sh
You can’t perform that action at this time.
0 commit comments