修复一些下载源失效的问题

This commit is contained in:
monlor
2020-06-20 11:58:59 +08:00
parent 37aa2192c4
commit 571e7b1841
7 changed files with 126 additions and 13 deletions

View File

@@ -5,7 +5,8 @@ export PATH=$PATH:/etc/mixbox/bin
mburl_coding="https://monlor.coding.net/p/mbfiles/d/mbfiles/git/lfs/master"
mburl_github="https://raw.githubusercontent.com/monlor/mbfiles/master"
mburl_gitee="https://gitee.com/monlor/mbfiles/raw/master"
mburl=$(mbdb get mixbox.main.url) || mburl="$mburl_gitee"
mburl_ghcdn="https://cdn.jsdelivr.net/gh/monlor/mbfiles"
mburl=$(mbdb get mixbox.main.url) || mburl="$mburl_coding"
mbroot=$(mbdb get mixbox.main.path)
mbdisk=$(mbdb get mixbox.main.mbdisk)
mbbackup="/etc/mbbackup"

View File

@@ -1,4 +1,4 @@
#!/bin/sh
e#!/bin/sh
#copyright by monlor
#------------------【Tools】--------------------
source /etc/mixbox/bin/base
@@ -172,6 +172,7 @@ modify_source() {
"$mburl_coding") url_text="coding下载源" ;;
"$mburl_github") url_text="github下载源" ;;
# "$mburl_gitee") url_text="gitee下载源" ;;
"$mburl_ghcdn") url_text="ghcdn下载源" ;;
*) url_text="$mburl" ;;
esac
echo "下载源【$url_text】使用中"
@@ -179,12 +180,14 @@ modify_source() {
echo "1. coding下载源"
echo "2. github下载源"
# echo "3. gitee下载源(推荐)"
echo "3. ghcdn下载源"
read -p "请选择或输入下载源:" res
case "$res" in
0) return ;;
1) mburl_tmp="$mburl_coding" ;;
2) mburl_tmp="$mburl_github" ;;
# 3) mburl_tmp="$mburl_gitee" ;;
3) mburl_tmp="$mburl_ghcdn" ;;
*) [ -n "$res" ] && mburl_tmp="$res" ;;
esac
if [ -n "$mburl_tmp" ]; then
@@ -286,7 +289,7 @@ menulist() {
checkuci $name && continue
fi
appver="$(cat $mbtmp/applist.txt | grep "^$name|" | cut -d'|' -f4)"
appver="$(cat $mbtmp/applist.txt &> /dev/null | grep "^$name|" | cut -d'|' -f4)"
echo $name >> ${mbtmp}/applist_menu.txt
let i=$i+1
args="\t"

View File

@@ -3,5 +3,5 @@ appname="mixbox"
needver=""
supports="linux_aarch64,linux_arm,linux_mips,linux_x86_64"
appinfo="一款支持多平台多架构的Shell工具箱"
newinfo="修复插件列表为空的bug"
version="0.1.9.11"
newinfo="新增下载源ghcdn"
version="0.1.9.12"

View File

@@ -5,5 +5,5 @@ supports="linux_aarch64,linux_arm,linux_mips,linux_x86_64"
openport="1"
backupfiles="config/ssserver.conf,config/sscontrol.conf,config/customize_black.conf,config/customize_white.conf"
appinfo="最好的翻墙工具,没有之一,还可以加速国内外游戏"
newinfo="更新v2ray配置生成脚本"
version="0.1.10"
newinfo="现在更新v2ray会测试二进制程序,防止软件源失效更新到错误的程序"
version="0.1.11"

View File

@@ -19,10 +19,16 @@ get_v2ray_bin() {
logsh "$service" "检测v2ray版本本地版本$result2,在线版本:$result1"
if [ "$result1" != "$result2" ]; then
logsh "$service" "版本不一致,正在更新..."
wgetsh ${mbroot}/apps/${appname}/bin/v2ray $mburl/appsbin/v2ray-bin/$model/v2ray
wgetsh ${mbroot}/apps/${appname}/bin/v2ctl $mburl/appsbin/v2ray-bin/$model/v2ctl
chmod +x ${mbroot}/apps/${appname}/bin/v2ray
chmod +x ${mbroot}/apps/${appname}/bin/v2ctl
wgetsh ${mbtmp}/v2ray $mburl/appsbin/v2ray-bin/$model/v2ray
wgetsh ${mbtmp}/v2ctl $mburl/appsbin/v2ray-bin/$model/v2ctl
chmod +x ${mbtmp}/v2ray
chmod +x ${mbtmp}/v2ctl
if ${mbtmp}/v2ray -version &> /dev/null; then
mv -f ${mbtmp}/v2ray ${mbroot}/apps/${appname}/bin/v2ray
mv -f ${mbtmp}/v2ctl ${mbroot}/apps/${appname}/bin/v2ctl
else
echo "测试v2ray程序失败跳过更新..."
fi
fi
fi
}