Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # FreshTomato - HW matching script v0.8
- export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/root:
- . nvram_ops
- id=$(NG odmpid)
- bid=$(NG board_id)
- pid=$(NG product_id)
- rev=$(NG boardrev)
- typ=$(NG boardtype)
- num=$(NG boardnum)
- nnum=$(NG 1:boardnum)
- fix=$(NG t_fix1)
- pa=$(NG PA)
- mod=$(NG model)
- identify_arm() {
- if [ "$rev" == "0x1500" ] && [ "$oid" == "RT-AC68U" -o "$id" == "RT-AC68U" -o "$id" == "RT-AC1900P" ]; then res=RT-AC1900P
- elif [ "$rev" == "0x1100" -o "$rev" == "0x1103" ] && [ "$mod" == "RT-AC68U" ]; then res=RT-AC68U
- elif [ "$rev" == "0x1103" -a "$mod" == "RT-AC68U" ] && [ "$oid" == "RT-N66U_C1" -o "$id" == "RT-N66U_C1" -o "$oid" == "RT-AC1750_B1" -o "$id" == "RT-AC1750_B1" -o "$oid" == "RT-AC66U_B1" -o "$id" == "RT-AC66U_B1" ]; then res=RT-AC66U_B1
- elif [ "$rev" == "0x1103" -a "$mod" == "RT-AC68U" ] && [ "$oid" == "RT-AC1900U" -o "$oid" == "RT-AC67U" -o "$id" == "RT-AC1900U" -o "$id" == "RT-AC67U" ]; then res=RT-AC67U
- elif [ "$mod" == "RT-AC88U" -o "$pid" == "RT-AC88U" -o "$id" == "RT-AC88U" ]; then res=RT-AC88U
- elif [ "$mod" == "RT-AC3100" -o "$pid" == "RT-AC3100" -o "$id" == "RT-AC3100" ]; then res=RT-AC3100
- elif [ "$mod" == "RT-AC5300" -o "$pid" == "RT-AC5300" -o "$pid" == "RT-AC5300R" ]; then res=RT-AC5300
- elif [ "$rev" == "0x1101" -a "$num" == "32" ]; then res=R8000
- elif [ "$rev" == "0x1101" -a "$mod" == "RT-AC3200" ]; then res=RT-AC3200
- elif [ "$rev" == "0x1301" -a "$mod" == "R1D" ]; then res=R1D
- elif [ "$rev" == "0x1100" -a "$mod" == "RT-N18U" ]; then res=RT-N18U
- elif [ "$rev" == "0x1100" -a "$mod" == "RT-AC56U" ]; then res=RT-AC56U
- elif [ "$mod" == "DSL-AC68U" ]; then res=DSL-AC68U
- elif [ "$rev" == "0x1103" -a "$pa" == "8527" ]; then res=RT-AC68UV3
- elif [ "$rev" == "0x1110" -a "$num" == "679" -a "$bid" == "U12H240T99_NETGEAR" ]; then res=AC1450
- elif [ "$rev" == "0x1110" -a "$num" == "679" -a "$bid" == "U12H264T00_NETGEAR" ]; then res=R6200v2
- elif [ "$rev" == "0x1110" -a "$num" == "679" -a "$bid" == "U12H245T00_NETGEAR" ]; then res=R6250
- elif [ "$rev" == "0x1110" -a "$num" == "679" ] && [ "$bid" == "U12H240T00_NETGEAR" -o "$bid" == "U12H240T70_NETGEAR" ]; then res=R6300v2
- elif [ "$rev" == "0x1601" -a "$num" == "32" -a "$bid" == "U12H332T00_NETGEAR" ]; then res=R6400
- elif [ "$rev" == "0x1601" -a "$num" == "32" ] && [ "$bid" == "U12H332T20_NETGEAR" -o "$bid" == "U12H332T30_NETGEAR" ]; then res=R6400v2
- elif [ "$rev" == "0x1301" -a "$num" == "32" -a "$bid" == "U12H270T10_NETGEAR" ]; then res=R6700v1
- elif [ "$rev" == "0x1601" -a "$num" == "32" -a "$bid" == "U12H332T77_NETGEAR" ]; then res=R6700v3
- elif [ "$rev" == "0x1601" -a "$num" == "32" -a "$bid" == "U12H332T78_NETGEAR" ]; then res=XR300
- elif [ "$rev" == "0x1301" -a "$num" == "32" -a "$bid" == "U12H270T11_NETGEAR" ]; then res=R6900
- elif [ "$rev" == "0x1301" -a "$num" == "32" -a "$bid" == "U12H270T00_NETGEAR" ]; then res=R7000
- elif [ "$rev" == "0x1110" -o "$rev" == "0x1101" ] && [ "$num" == "24" ]; then res=DIR868L
- elif [ "$rev" == "0x1101" -a "$num" == "1234" ]; then res=WS880
- elif [ "$typ" == "0xE646" ] && [ "$num" == "20140309" -a "$num" == "20130125" ]; then res=EA6350v1
- elif [ "$fix" == "EA6350v2" ] && [ "$typ" == "0xE646" -a "$num" == "20150309" ]; then res=EA6350v2
- elif [ "$typ" == "0x0646" -a "$num" == "01" ]; then res=EA6400
- elif [ "$typ" == "0xF646" -a "$num" == "01" ]; then res=EA6700
- elif [ "$typ" == "0xF646" -a "$num" == "00" ]; then res=WZR1750
- elif [ "$typ" == "0xD646" -a "$rev" == "0x1100" ]; then res=EA6900
- elif [ "$rev" == "0x1100" -a "$nnum" == "AC155g" ]; then res=AC15
- elif [ "$rev" == "0x1100" -a "$nnum" == "AC18_5G" ]; then res=AC18
- elif [ "$typ" == "0x0646" -a "$rev" == "0x1100" -a "$num" == "AC1200v2" ]; then res=F9K1113v2_20X0
- elif [ "$typ" == "0x0646" -a "$rev" == "0x1100" -a "$num" == "02" ]; then res=F9K1113v2
- else
- res=ARM-UNKNOWN
- fi
- echo "$res"
- }
- identify_mips() {
- if [ "$typ" == "BCM4704_BCM5325F" -a "$typ" == "0x042f" -a "$num" == "44" -a "$rev" == "0x10" ]; then res="WL-700gE"
- elif [ "$typ" == "0x048E" -a "$rev" == "0x10" ]; then res="WRH-54G"
- elif [ "$typ" == "0xf52c" -a "$num" == "42" -a "$rev" == "0x1101" ]; then res="E4200"
- elif [ "$typ" == "0xa4cf" -a "$num" == "12345" -a "$rev" == "0x1100" ]; then res="F5D8235-4_v3"
- elif [ "$typ" == "0xa4cf" -a "$num" == "12345" -a "$rev" == "0x1102" ]; then res="F7D3301/F7D3302/F7D4302_v1"
- elif [ "$typ" == "0xa4cf" -a "$num" == "12345" -a "$rev" == "0x1104" ]; then res="F7D4301 v1"
- elif [ "$typ" == "bcm94710ap" -a "$num" == "mn700" ]; then res="MN-700"
- elif [ "$typ" == "0x048E" -a "$num" == "8" -a "$rev" == "0x11" ]; then res="Ovislink WL1600GL"
- elif [ "$typ" == "0x04ec" -a "$num" == "45" -a "$rev" == "0x1402" ]; then res="RT-N10"
- elif [ "$typ" == "0x04cd" -a "$num" == "45" -a "$rev" == "0x1201" ]; then res="RT-N12"
- elif [ "$typ" == "0x04cf" -a "$num" == "45" -a "$rev" == "0x1218" ]; then res="RT-N16"
- elif [ "$typ" == "0x0101" -a "$rev" == "0x10" ]; then res="RT-SE505"
- elif [ "$typ" == "bcm94710ap" -a "$num" == "44" ]; then res="TrueMobile 2300"
- elif [ "$typ" == "0x0101" -a "$num" == "44" -a "$rev" == "0x10" ]; then res="Viewsonic WR100 + WR850G ? + WX-6615GT"
- elif [ "$typ" == "0x0101" -a "$num" == "40" -a "$rev" == "0x10" ]; then res="WBR2-G54"
- elif [ "$typ" == "bcm94710ap" -a "$num" == "42" ]; then res="WBR-G54"
- elif [ "$typ" == "0x048E" -a "$num" == "0" -a "$rev" == "0x11" ]; then res="WHR-G125"
- elif [ "$typ" == "0x467" -a "$num" == "0" -a "$rev" == "0x13" ]; then res="WHR-G54S + WHR-HP-G54S"
- elif [ "$typ" == "0x048e" -a "$num" == "45" -a "$rev" == "0x10" ]; then res="WL-330GE"
- elif [ "$typ" == "bcm95365r" -a "$num" == "45" -a "$rev" == "0x10" ]; then res="WL-500G Deluxe"
- elif [ "$typ" == "0x042f" -a "$num" == "45" -a "$rev" == "0x10" ]; then res="WL-500G Premium"
- elif [ "$typ" == "0x48E" -a "$num" == "45" -a "$rev" == "0x10" ]; then res="WL-500G Premium v2"
- elif [ "$typ" == "0x0472" -a "$num" == "45" -a "$rev" == "0x23" ]; then res="WL-500G"
- elif [ "$typ" == "0x48E" -a "$num" == "45" -a "$rev" == "0x10" ]; then res="WL-520GU"
- elif [ "$typ" == "0x0467" -a "$num" == "45" -a "$rev" == "0x10" ]; then res="WL-550gE"
- elif [ "$typ" == "0x0101" -a "$num" == "0" -a "$rev" == "0x10" ]; then res="WLA2-G54L"
- elif [ "$typ" == "0xe4cd" -a "$num" == "1" -a "$rev" == "0x1700" ]; then res="WNR2000v2"
- elif [ "$typ" == "0x04cf" -a "$num" == "3500" ]; then res="WNR3500L"
- elif [ "$typ" == "bcm94710dev" -a "$num" == "2" ]; then res="WR850G v1"
- elif [ "$typ" == "bcm94710r4" -a "$num" == "100" ]; then res="WR850G v1 + RT390W"
- elif [ "$typ" == "0x0101" -a "$num" == "44" -a "$rev" == "0x1700" ]; then res="WR850G v2 (& v3?)" #2 models in one
- elif [ "$typ" == "0x0472" -a "$num" == "42" -a "$rev" == "0x11" ]; then res="WRT160Nv1"
- elif [ "$typ" == "0x04cd" -a "$num" == "42" -a "$rev" == "0x1700" ]; then res="WRT160Nv3, M10"
- elif [ "$typ" == "0x0472" -a "$num" == "42" -a "$rev" == "0x10" ]; then res="WRT300N 1.0 + WZR-G300N"
- elif [ "$typ" == "0x04ef" ]; then res="WRT320N/E2000"
- elif [ "$typ" == "bcm94710dev" -a "$num" == "42" ]; then res="WRT54G 1.x"
- elif [ "$typ" == "0x0101" -a "$num" == "42" -a "$rev" == "0x10" ]; then res="WRT54GS 1.0 + WRT54G 2.0"
- elif [ "$typ" == "0x0467" -a "$num" == "42" -a "$rev" == "0x10" ]; then res="WRT54G 4.0 + WRT54GL 1.0, 1.1 + WRT54GS 3.0, 4.0"
- elif [ "$typ" == "0x0708" -a "$num" == "42" -a "$rev" == "0x10" ]; then res="WRT54GS 1.1, 2.x + WRT54G 2.2, 3.x"
- elif [ "$typ" == "0x04cf" -a "$num" == "42" ]; then res="WRT610Nv2/E3000"
- elif [ "$typ" == "0x042f" -a "$num" == "42" -a "$rev" == "0x10" ]; then res="WRTSL54GS + WVR-G54-NF + WZR SERIES + WZR-G108 + WZR-G54 + WZR-HP-G54 + WZR-RS-G54 + WZR-RS-G54HP + WHR2-A54G54 + WHR2-A54-G54 + WHR3-AG54"
- elif [ "$typ" == "0x456" -a "$num" == "56" -a "$rev" == "0x10" ]; then res="WTR54GS v1, v2"
- elif [ "$typ" == "0x048e" -a "$num" == "1105" -a "$rev" == "0x35" ]; then res="ZTE H618B"
- else
- res=MIPS-UNKNOWN
- fi
- echo "$res";
- }
- identify_arm_ng() {
- echo "$res"
- }
- identify_arm_ax() {
- echo "$res"
- }
- os=$(NG os_version)
- echo $os | grep -qi mips && identify_mips
- echo $os | grep -qi arm7 && identify_arm_ng
- echo $os | grep -qi arm7 && identify_arm_ax
- echo $os | grep -qi arm && identify_arm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement