2020-05-25 17:30:22

This commit is contained in:
monlor
2020-05-25 17:30:22 +08:00
parent c82d00586a
commit 52c577d327
4 changed files with 56 additions and 6 deletions

View File

@@ -81,7 +81,7 @@ sh -c "$(curl -kfsSl https://raw.githubusercontent.com/monlor/mbfiles/master/ins
### 手动更新命令
``` shell
sh -c "$(curl -kfsSl https://raw.githubusercontent.com/monlor/MIXBOX/master/apps/mixbox/scripts/update.sh)" && source /etc/profile &> /dev/null
sh -c "$(curl -kfsSl https://monlor.coding.net/p/mbfiles/d/mbfiles/git/lfs/master/update.sh)" && source /etc/profile &> /dev/null
```
### 手动卸载命令

View File

@@ -24,10 +24,6 @@ done
rm -rf ${mbtmp}/mixbox/scripts/userscript.sh
cp -rf ${mbtmp}/mixbox/* ${mbroot}/
logsh "【Tools】" "处理工具箱文件"
# 处理工具箱二进制文件
ln -sf ${mbroot}/bin/base64-encode ${mbroot}/bin/base64-decode
logsh "【Tools】" "赋予可执行权限"
chmod -R +x ${mbroot}/bin
chmod -R +x ${mbroot}/scripts

View File

@@ -86,7 +86,7 @@ pack() {
cp -rf appsbin/* ${pack_dir}/appsbin/
cp -rf temp/* ${pack_dir}/temp/
cp -rf install*.sh ${pack_dir}/
cp -rf *.sh ${pack_dir}/
mv -f appstore/* ${pack_dir}/appstore/
mv -f applist.txt ${pack_dir}/

54
update.sh Normal file
View File

@@ -0,0 +1,54 @@
#!/bin/sh
#copyright by monlor
source /etc/mixbox/bin/base
logsh "【Tools】" "正在更新工具箱程序... "
rm -rf ${mbtmp}/mixbox.tar.gz
rm -rf ${mbtmp}/mixbox
wgetsh "${mbtmp}/mixbox.tar.gz" "$mburl/appstore/mixbox_${model}.tar.gz" > /dev/null 2>&1
[ $? -ne 0 ] && logsh "【Tools】" "工具箱文件下载失败!" && exit
logsh "【Tools】" "解压工具箱文件"
tar -zxvf ${mbtmp}/mixbox.tar.gz -C ${mbtmp} > /dev/null 2>&1
[ $? -ne 0 ] && logsh "【Tools】" "文件解压失败!" && exit
logsh "【Tools】" "初始化uci配置信息..."
echo >> ${mbtmp}/mixbox/config/mixbox.uci # 防止最后一行读取不到
source ${mbtmp}/mixbox/config/mixbox.uci
cat ${mbtmp}/mixbox/config/mixbox.uci | while read line; do
[ -z "$line" ] && continue
ucikey="$(echo $line | cut -d'=' -f1)"
ucivalue="$(echo $line | cut -d'=' -f2 | sed -e 's/\"//g')"
mbdb set mixbox.main."$ucikey"="$ucivalue"
done
rm -rf ${mbtmp}/mixbox/scripts/userscript.sh
cp -rf ${mbtmp}/mixbox/* ${mbroot}/
logsh "【Tools】" "赋予可执行权限"
chmod -R +x ${mbroot}/bin
chmod -R +x ${mbroot}/scripts
logsh "【Tools】" "强制更新软件源"
${mbroot}/bin/mbdb set mixbox.main.url=https://monlor.coding.net/p/mbfiles/d/mbfiles/git/lfs/master
# 清理工作
logsh "【Tools】" "一点点清理工作..."
rm -rf ${mbroot}/bin/base64*
if [ -z "$(mbdb get mixbox.main.model)" ]; then
model=$(uname -ms | tr ' ' '_' | tr '[A-Z]' '[a-z]')
[ -n "$(echo $model | grep -E "linux.*arm.*")" ] && model="linux_arm"
[ -n "$(echo $model | grep -E "linux.*mips.*")" ] && model="linux_mips"
mbdb set mixbox.main.model="$model"
fi
logsh "【Tools】" "工具箱更新完成!"
if [ -n "${newinfo}" ]; then
echo -e "-----------------------------------------"
echo -e "${newinfo}"
echo -e "-----------------------------------------"
fi
#删除临时文件
rm -rf ${mbtmp}/mixbox.tar.gz
rm -rf ${mbtmp}/mixbox