diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 806320d..a3653d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,8 +53,10 @@ jobs: cp -rf install.sh mbfiles/ - name: Push changes env: - GH_REF: ${{ secrets.GH_REF }} - CO_REF: ${{ secrets.CO_REF }} + GH_REF: github.com/monlor/mbfiles + GE_REF: gitee.com/monlor/mbfiles + GH_TOKEN: ${{ secrets.GH_TOKEN }} + GE_TOKEN: ${{ secrets.GE_TOKEN }} BRANCH_NAME: $(cd .. && git branch | awk '$1 == "*"{print $2}') run: | cd mbfiles/ @@ -64,5 +66,5 @@ jobs: git add . git commit -m "$(TZ='Asia/Shanghai' date "+%Y-%m-%d %H:%M:%S")" -a eval "git branch | grep -q "${BRANCH_NAME}" || git checkout -b "${BRANCH_NAME}"" - eval "git push "${GH_REF}" "${BRANCH_NAME}":"${BRANCH_NAME}" -f" - # eval "git push "${CO_REF}" "${BRANCH_NAME}":"${BRANCH_NAME}" -f" \ No newline at end of file + eval "git push "https://${GH_TOKEN}@${GH_REF}" "${BRANCH_NAME}":"${BRANCH_NAME}" -f" + eval "git push "https://${GE_TOKEN}@${GE_REF}" "${BRANCH_NAME}":"${BRANCH_NAME}" -f" diff --git a/README.md b/README.md index a62f4b1..dba2af6 100644 --- a/README.md +++ b/README.md @@ -88,19 +88,19 @@ #### 一键安装 ``` shell -sh -c "$(curl -kfsSl https://cdn.jsdelivr.net/gh/monlor/mbfiles@master/install.sh)" && source /etc/profile &> /dev/null +sh -c "$(curl -kfsSl https://gitee.com/monlor/mbfiles/raw/master/install.sh)" && source /etc/profile &> /dev/null ``` ### 手动更新命令 ``` shell -sh -c "$(curl -kfsSl https://cdn.jsdelivr.net/gh/monlor/MIXBOX@master/apps/mixbox/scripts/update.sh)" && source /etc/profile &> /dev/null +sh -c "$(curl -kfsSl https://raw.githubusercontent.com/monlor/MIXBOX/master/apps/mixbox/scripts/update.sh)" && source /etc/profile &> /dev/null ``` #### 卸载`Monlor Tools`工具箱 ``` shell -sh -c "$(curl -kfsSl https://cdn.jsdelivr.net/gh/monlor/mbfiles@master/temp/uninstall_old.sh)" && source /etc/profile &> /dev/null +sh -c "$(curl -kfsSl https://gitee.com/monlor/mbfiles/raw/master/temp/uninstall_old.sh)" && source /etc/profile &> /dev/null ``` #### 一键更新所有插件(请先更新工具箱) diff --git a/apps/mixbox/bin/mixbox b/apps/mixbox/bin/mixbox index 6233bd8..0cbd00c 100644 --- a/apps/mixbox/bin/mixbox +++ b/apps/mixbox/bin/mixbox @@ -130,12 +130,13 @@ backup() { cp -rf ${mbroot}/mbdb $mbbackup applist installed -n | while read line; do echo "$(mbdb get ${line}.main.backupfiles)" | tr ',' '\n' | while read file; do - [ -z "$file" ] && continue + [ -z "$file" ] && continue savepath="$(dirname $mbbackup/${line}/$file)" [ ! -d "$savepath" ] && mkdir -p $savepath cp -rf ${mbroot}/apps/${line}/$file $mbbackup/${line}/$file &> /dev/null done done + cp -rf ${mbroot}/config/applist.txt $mbbackup/applist.txt cp -rf ${mbroot}/scripts/userscript.sh $mbbackup/userscript.sh cp -rf ${mbroot}/mbdb $mbbackup/mbdb tar zcvf "$mbbackup".tar.gz $mbbackup > /dev/null 2>&1 diff --git a/apps/mixbox/bin/versioncmp_linux_arm b/apps/mixbox/bin/versioncmp_linux_arm deleted file mode 100644 index 9eae185..0000000 Binary files a/apps/mixbox/bin/versioncmp_linux_arm and /dev/null differ diff --git a/apps/mixbox/bin/versioncmp_linux_mips b/apps/mixbox/bin/versioncmp_linux_mips deleted file mode 100644 index ae0c7d5..0000000 Binary files a/apps/mixbox/bin/versioncmp_linux_mips and /dev/null differ diff --git a/apps/mixbox/bin/versioncmp_linux_x86_64 b/apps/mixbox/bin/versioncmp_linux_x86_64 deleted file mode 100644 index e0c7a5b..0000000 Binary files a/apps/mixbox/bin/versioncmp_linux_x86_64 and /dev/null differ diff --git a/apps/mixbox/config/mixbox.uci b/apps/mixbox/config/mixbox.uci index 16b2b1f..192b3a2 100644 --- a/apps/mixbox/config/mixbox.uci +++ b/apps/mixbox/config/mixbox.uci @@ -4,4 +4,4 @@ needver="" supports="linux_arm,linux_mips,linux_x86_64" appinfo="一款支持多平台,多架构的Shell工具箱" newinfo="新增base64_encode工具" -version="0.1.8" +version="0.1.9" diff --git a/apps/mixbox/scripts/helper.sh b/apps/mixbox/scripts/helper.sh index cc1532f..fd45f1d 100644 --- a/apps/mixbox/scripts/helper.sh +++ b/apps/mixbox/scripts/helper.sh @@ -58,4 +58,20 @@ base_decode() { echo -n "$*" | baseutil --b64 -d fi fi -} \ No newline at end of file +} + +# $1 > $2 => -1 +# $1 < $2 => 1 +# $1 = $2 => 0 +versioncmp() { + + [ "$1" = "$2" ] && echo -n "0" && return + + if test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; then + echo -n "-1" + else + echo -n "1" + fi + +} + diff --git a/install.sh b/install.sh index 1c55a36..bc14421 100644 --- a/install.sh +++ b/install.sh @@ -17,7 +17,7 @@ logsh "【Tools】" "请按任意键安装工具箱(Ctrl + C 退出)." read answer #check root # [ "$USER" != "root" ] && logsh "【Tools】" "请使用root用户安装工具箱!" && exit 1 -mburl="https://monlor.coding.net/p/mbfiles/d/mbfiles/git/raw/master" +mburl="https://gitee.com/monlor/mbfiles/raw/master" mbtmp="/tmp/mbtmp" [ ! -d "${mbtmp}" ] && mkdir -p ${mbtmp} model=$(uname -ms | tr ' ' '_' | tr '[A-Z]' '[a-z]') @@ -55,7 +55,7 @@ else fi [ "$result" != "200" ] && logsh "【Tools】" "文件下载失败!" && exit 1 logsh "【Tools】" "解压工具箱文件" -tar -zxvf ${mbtmp}/mixbox.tar.gz -C ${mbtmp} +tar -zxvf ${mbtmp}/mixbox.tar.gz -C ${mbtmp} > /dev/null [ $? -ne 0 ] && logsh "【Tools】" "文件解压失败!" && exit 1 # 安装工具箱文件 cp -rf ${mbtmp}/mixbox ${mbroot}