Skip to content

Commit edc45d5

Browse files
committed
Update mw.tpl
1 parent ed73223 commit edc45d5

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

Diff for: scripts/init.d/mw.tpl

+11-12
Original file line numberDiff line numberDiff line change
@@ -322,18 +322,17 @@ mw_update_venv()
322322

323323
mw_mirror()
324324
{
325-
# LOCAL_ADDR=common
326-
# cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
327-
# if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
328-
# LOCAL_ADDR=cn
329-
# fi
330-
331-
# if [ "$LOCAL_ADDR" == "common" ];then
332-
# bash <(curl --insecure -sSL https://raw.githubusercontent.com/midoks/change-linux-mirrors/main/change-mirrors.sh)
333-
# else
334-
# bash <(curl -sSL https://linuxmirrors.cn/main.sh)
335-
# fi
336-
bash <(curl -sSL https://linuxmirrors.cn/main.sh)
325+
LOCAL_ADDR=common
326+
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
327+
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
328+
LOCAL_ADDR=cn
329+
fi
330+
331+
if [ "$LOCAL_ADDR" == "common" ];then
332+
bash <(curl --insecure -sSL https://raw.githubusercontent.com/midoks/change-linux-mirrors/main/change-mirrors.sh)
333+
else
334+
bash <(curl -sSL https://linuxmirrors.cn/main.sh)
335+
fi
337336
cd ${ROOT_PATH}
338337
}
339338

0 commit comments

Comments
 (0)