Open kele2016 opened 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 让系统自动来判断架构?
uname -a
uname -m 可以解决部分问题,对于arm和mips大小端无法准确判断,所以需要采用手动方式来确认
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
让系统自动来判断架构?