Browse Source

wget depends: fix someone force install the luci package

rufengsuixing 5 years ago
parent
commit
ea34ffff2e
1 changed files with 4 additions and 2 deletions
  1. 4 2
      root/usr/share/AdGuardHome/update_core.sh

+ 4 - 2
root/usr/share/AdGuardHome/update_core.sh

@@ -25,8 +25,10 @@ clean_log(){
 
 check_latest_version(){
 	latest_ver="$(wget -O- https://api.github.com/repos/AdguardTeam/AdGuardHome/releases/latest 2>/dev/null|grep -E 'tag_name' |grep -E 'v[0-9.]+' -o 2>/dev/null)"
-	[ -z "${latest_ver}" ] && echo -e "\nFailed to check latest version, please try again later."  && exit 1
-	
+	if [ -z "${latest_ver}" ]; then
+		wget -V | grep +https >/dev/null || (opkg update && opkg remove wget-nossl --force-depends && opkg install wget && check_latest_version && exit 0) 
+		echo -e "\nFailed to check latest version, please try again later."  && exit 1
+	fi
 	if [ -f "$configpath" ]; then
 		now_ver="$($binpath -c $configpath --check-config 2>&1| grep -m 1 -E 'v[0-9.]+' -o)"
 	elif [ -f "$binpath" ]; then