install.sh: enable openwrt-19.x version support
This commit is contained in:
parent
1ac2cf5f36
commit
1f058707c7
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
## How to install prebuilt packages (OpenWrt 21 & 22 & master)
|
## How to install prebuilt packages (OpenWrt 19 & 21 & 22 & master)
|
||||||
|
|
||||||
- Login OpenWrt terminal (SSH)
|
- Login OpenWrt terminal (SSH)
|
||||||
|
|
||||||
|
10
install.sh
10
install.sh
@ -10,7 +10,7 @@ platform=$(opkg print-architecture | awk 'END{print $2}')
|
|||||||
# TMP
|
# TMP
|
||||||
TMPDIR=$(mktemp -d) || exit 1
|
TMPDIR=$(mktemp -d) || exit 1
|
||||||
|
|
||||||
# MYIP
|
# GitHub mirror
|
||||||
ip_info=$(curl -s https://ip.cooluc.com)
|
ip_info=$(curl -s https://ip.cooluc.com)
|
||||||
country_code=$(echo $ip_info | sed -r 's/.*country_code":"([^"]*).*/\1/')
|
country_code=$(echo $ip_info | sed -r 's/.*country_code":"([^"]*).*/\1/')
|
||||||
if [ $country_code = "CN" ]; then
|
if [ $country_code = "CN" ]; then
|
||||||
@ -25,20 +25,22 @@ CHECK() (
|
|||||||
echo -e "\r\n${GREEN_COLOR}Checking available space ...${RES}"
|
echo -e "\r\n${GREEN_COLOR}Checking available space ...${RES}"
|
||||||
ROOT_SPACE=$(df -m /usr | awk 'END{print $4}')
|
ROOT_SPACE=$(df -m /usr | awk 'END{print $4}')
|
||||||
if [ $ROOT_SPACE -lt 40 ]; then
|
if [ $ROOT_SPACE -lt 40 ]; then
|
||||||
echo -e "${RED_COLOR}Error, The system storage space is less than 40MB.${RES}"
|
echo -e "\r\n${RED_COLOR}Error, The system storage space is less than 40MB.${RES}"
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
echo -e "\r\n${GREEN_COLOR}Checking platform ...${RES}\r\n"
|
echo -e "\r\n${GREEN_COLOR}Checking platform ...${RES}\r\n"
|
||||||
prebuilt="aarch64_cortex-a53 aarch64_cortex-a72 aarch64_generic arm_arm1176jzf-s_vfp arm_arm926ej-s arm_cortex-a15_neon-vfpv4 arm_cortex-a5_vfpv4 arm_cortex-a7 arm_cortex-a7_neon-vfpv4 arm_cortex-a8_vfpv3 arm_cortex-a9 arm_cortex-a9_neon arm_cortex-a9_vfpv3-d16 arm_fa526 arm_mpcore arm_xscale i386_pentium-mmx i386_pentium4 mips64_octeonplus mips_24kc mips_4kec mips_mips32 mipsel_24kc mipsel_24kc_24kf mipsel_74kc mipsel_mips32 x86_64"
|
prebuilt="aarch64_cortex-a53 aarch64_cortex-a72 aarch64_generic arm_arm1176jzf-s_vfp arm_arm926ej-s arm_cortex-a15_neon-vfpv4 arm_cortex-a5_vfpv4 arm_cortex-a7 arm_cortex-a7_neon-vfpv4 arm_cortex-a8_vfpv3 arm_cortex-a9 arm_cortex-a9_neon arm_cortex-a9_vfpv3-d16 arm_fa526 arm_mpcore arm_xscale i386_pentium-mmx i386_pentium4 mips64_octeonplus mips_24kc mips_4kec mips_mips32 mipsel_24kc mipsel_24kc_24kf mipsel_74kc mipsel_mips32 x86_64"
|
||||||
if [[ "$version" != "21" ]] && [[ "$version" != "22" ]]; then
|
verif=$(expr match "$prebuilt" ".*\($platform\)")
|
||||||
|
if [ "$version" != 19 -a "$version" != 21 -a "$version" != 22 ]; then
|
||||||
echo -e "${RED_COLOR}Error! OpenWrt \"$(cat /etc/os-release | grep VERSION_ID | awk -F "[\"\"]" '{print $2}')\" version is not supported.${RES}"
|
echo -e "${RED_COLOR}Error! OpenWrt \"$(cat /etc/os-release | grep VERSION_ID | awk -F "[\"\"]" '{print $2}')\" version is not supported.${RES}"
|
||||||
exit 1;
|
exit 1;
|
||||||
elif [[ ! "$prebuilt" =~ "$platform" ]]; then
|
elif [[ ! $verif ]]; then
|
||||||
echo -e "${RED_COLOR}Error! The current \"$platform\" platform is not currently supported.${RES}"
|
echo -e "${RED_COLOR}Error! The current \"$platform\" platform is not currently supported.${RES}"
|
||||||
exit 1;
|
exit 1;
|
||||||
else
|
else
|
||||||
echo -e "${GREEN_COLOR}Update opkg sources ...${RES}"
|
echo -e "${GREEN_COLOR}Update opkg sources ...${RES}"
|
||||||
opkg update
|
opkg update
|
||||||
|
opkg install luci-compat
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user