felix-fly / v2ray-openwrt

路由器Openwrt手工/脚本/ipk包安装V2ray简单流程
658 stars 159 forks source link

脚本问题疑问 #16

Open kele2016 opened 4 years ago

kele2016 commented 4 years ago

platform="$1" all=",386,amd64,armv5,armv6,armv7,arm64,mips,mipsle,mips64,mips64le,ppc64,ppc64le,s390x," result=$(echo $all | grep ",${platform},") if [[ "$result" != "" ]] then echo "Your router platform: $platform" else echo "Unknown platform: $platform" exit fi

这里为什么不写成uname -m platform=uname -a 让系统自动来判断架构?

felix-fly commented 4 years ago

uname -m 可以解决部分问题,对于arm和mips大小端无法准确判断,所以需要采用手动方式来确认