moxbox init

This commit is contained in:
monlor
2020-03-05 00:08:40 +08:00
commit 76dbe98978
856 changed files with 170708 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
service="HttpFile"
appname="httpfile"
needver="0.0.1"
supports="linux_arm,linux_mips,linux_x86_64"
newinfo="脚本逻辑错误"
appinfo="搭建简单的web文件浏览页面"
version="0.0.3"

View File

@@ -0,0 +1,56 @@
#------------------【HttpFile】--------------------
httpfile() {
eval `mbdb export httpfile`
source /etc/mixbox/bin/base
echo "********* $service ***********"
echo "[${appinfo}]"
echo "[如需使用ONMP请停止本插件]"
[ -z "$(mbdb show entware)" ] && echo "请先安装Entware插件" && return
readsh "启动${appname}服务[1/0] " "enable" "1"
if [ "$enable" == '1' ]; then
echo "${appname}全部配置: "
allinfo=$(mbdb show $appname.web)
[ -z "$allinfo" ] && echo "未添加配置!" || echo "$allinfo"
read -p "是否要更改${appname}配置?[1/0] " res
if [ "$res" == '1' ]; then
read -p "添加${appname}配置?[1/0] " res
if [ "$res" == '1' ]; then
while(true)
do
read -p "请输入${appname}配置名称: " name
read -p "请输入${appname}运行端口号: " port
read -p "请输入${appname}访问路径: " path
if [ -z "$name" -o -z "${port}" -o -z "$path" ]; then
echo "配置不能为空,未添加!"
else
mbdb set $appname.web.$name="${port},$path"
fi
echo "已添加配置[$name $path ${port}]"
read -p "继续添加配置?[1/0] " res
[ "$res" == '0' -o -z "$res" ] && break
done
fi
read -p "删除${appname}配置?[1/0] " res
if [ "$res" == '1' ]; then
read -p "清空配置再添加?[1/0] " res
[ "$res" == '1' ] && mbdb clear $appname.web
echo "["$(mbdb keys $appname.web)"]"
while(true)
do
read -p "请输入要删除的配置名: " res
[ ! -z "$res" ] && mbdb del $appname.web.$res
read -p "继续删除配置?[1/0] " res
[ "$res" == '0' -o -z "$res" ] && break
done
fi
fi
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
else
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
fi
}
#------------------【HttpFile】--------------------