mirror of
https://github.com/monlor/MIXBOX-ARCHIVE.git
synced 2026-03-14 09:21:27 +00:00
改善插件配置文件,优化applist
This commit is contained in:
@@ -67,9 +67,24 @@ get_applist() {
|
||||
}
|
||||
|
||||
update_applist() {
|
||||
|
||||
wgetsh ${mbtmp}/applist_tmp.txt $mburl/applist.txt
|
||||
if [ $? -eq 0 ]; then
|
||||
cat ${mbtmp}/applist_tmp.txt | grep "${model}" | sort -u > ${mbtmp}/applist.txt
|
||||
rm -rf ${mbtmp}/applist.txt
|
||||
cat ${mbtmp}/applist_tmp.txt | grep "${model}" | sort -u | while read line; do
|
||||
local install_text=""
|
||||
local update_text=""
|
||||
local appname=""
|
||||
local version=""
|
||||
appname="$(echo -n "$line" | cut -d'|' -f1)"
|
||||
version="$(echo -n "$line" | cut -d '|' -f4)"
|
||||
if ls ${mbroot}/apps/${appname} &> /dev/null; then
|
||||
[ "$(mbdb get ${appname}.main.version)" != "${version}" ] && update_text="有更新"
|
||||
else
|
||||
install_text="未安装"
|
||||
fi
|
||||
echo "${line}|${install_text}|${update_text}" >> ${mbtmp}/applist.txt
|
||||
done
|
||||
fi
|
||||
rm -rf ${mbtmp}/applist_tmp.txt
|
||||
}
|
||||
|
||||
@@ -335,9 +335,18 @@ select_app() {
|
||||
read -p "是否要更新${appname}插件?[1/0] " update
|
||||
[ "$update" == '1' ] && ${mbroot}/scripts/appmanage.sh upgrade ${appname}
|
||||
fi
|
||||
|
||||
source "${mbroot}"/apps/${appname}/config/mixbox.conf
|
||||
${appname}
|
||||
# todo 配置方式修改
|
||||
if [ -f ${mbroot}/apps/${appname}/config.sh ]; then
|
||||
${mbroot}/apps/${appname}/config.sh
|
||||
if [ $? -eq 0 ]; then
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
else
|
||||
source "${mbroot}"/apps/${appname}/config/mixbox.conf
|
||||
${appname}
|
||||
fi
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh status
|
||||
fi
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user