update 2023-04-24 23:35:42

This commit is contained in:
github-actions[bot] 2023-04-24 23:35:42 +08:00
parent 163f1ba7eb
commit c42dce5ed3
2 changed files with 7 additions and 4 deletions

View File

@ -10,7 +10,7 @@ PKG_NAME:=luci-app-cloudflarespeedtest
LUCI_TITLE:=LuCI support for Cloudflares Speed Test
LUCI_DEPENDS:=+cdnspeedtest +openssl-util +curl
LUCI_PKGARCH:=all
PKG_VERSION:=1.5.1
PKG_VERSION:=1.5.2
PKG_RELEASE:=0
PKG_LICENSE:=AGPL-3.0
PKG_MAINTAINER:=mingxiaoyu <fengying0347@163.com>

View File

@ -158,10 +158,13 @@ function ip_replace(){
function host_ip() {
if [ "x${HOST_enabled}" == "x1" ] ;then
get_servers_config "host_domain"
HOSTS_LINE="$bestip $host_domain"
if [ -n "$(grep $host_domain /etc/hosts)" ]
HOSTS_LINE=$(echo "$host_domain" | sed 's/,/ /g' | sed "s/^/$bestip /g")
host_domain_first=$(echo "$host_domain" | awk -F, '{print $1}')
if [ -n "$(grep $host_domain_first /etc/hosts)" ]
then
sed -i".bak" "/$host_domain/d" /etc/hosts
echo $host_domain_first
sed -i".bak" "/$host_domain_first/d" /etc/hosts
echo $HOSTS_LINE >> /etc/hosts;
else
echo $HOSTS_LINE >> /etc/hosts;