From 887b5b967faf8ef55793ad646b746a7109b7dd08 Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 30 Jan 2023 12:47:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8A=A5=E9=94=99=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OYO/usr/bin/oyo | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/OYO/usr/bin/oyo b/OYO/usr/bin/oyo index 8842174..a36640f 100644 --- a/OYO/usr/bin/oyo +++ b/OYO/usr/bin/oyo @@ -5,6 +5,19 @@ load_transhell YY_APT_FAST=/opt/durapps/oyo/apt-fast/yy-apt-fast YOYO_GETFASTMIRROR=/opt/durapps/oyo/yoyo-getfastmirror/yoyo-getfastmirror + +function update-apt-fast-conf() +{ +${YOYO_GETFASTMIRROR} getfastmirror +local YYGFMR_EXIT_CODE="$?" + +if [ "${YYGFMR_EXIT_CODE}" != "0" ];then +echo "${TRANSHELL_CONTENT_FAILED_TO_GET_MIRROR_INFO}" +exit ${YYGFMR_EXIT_CODE} +fi + +apt-get update +} #####没有conf还不是root的就先root下获取conf if [ ! -e /tmp/oyo/apt-fast.conf] && [ "$(id -u)" != "0" ];then echo -e "${TRANSHELL_CONTENT_APT_FAST_CONF_NOT_FOUND_NEED_AUTH_TO_UPDATE}" @@ -14,14 +27,11 @@ fi ##### 没有conf的获取conf再进行操作 if [ ! -e /tmp/oyo/apt-fast.conf];then -${YOYO_GETFASTMIRROR} -apt-get update - +update-apt-fast-conf fi ##### yyupdate手动操作更新 if [ "$1" = "yyupdate" ];then -${YOYO_GETFASTMIRROR} -apt-get update +update-apt-fast-conf ##### 其他的直接转给apt-fast else ${YY_APT_FAST} $@