mirror of
https://github.com/monlor/MIXBOX-ARCHIVE.git
synced 2026-03-10 23:41:27 +00:00
新增插件dms,一款DLNA媒体服务器
This commit is contained in:
BIN
apps/dms/bin/dms_linux_arm
Executable file
BIN
apps/dms/bin/dms_linux_arm
Executable file
Binary file not shown.
BIN
apps/dms/bin/dms_linux_mips
Executable file
BIN
apps/dms/bin/dms_linux_mips
Executable file
Binary file not shown.
BIN
apps/dms/bin/dms_linux_x86_64
Executable file
BIN
apps/dms/bin/dms_linux_x86_64
Executable file
Binary file not shown.
8
apps/dms/config/dms.uci
Normal file
8
apps/dms/config/dms.uci
Normal file
@@ -0,0 +1,8 @@
|
||||
service="DMS"
|
||||
appname="dms"
|
||||
needver="0.0.1"
|
||||
backupfiles=""
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_linux_x86_64"
|
||||
appinfo="dms是一款DLNA数字媒体服务器"
|
||||
newinfo=""
|
||||
version="0.0.1"
|
||||
21
apps/dms/config/mixbox.conf
Normal file
21
apps/dms/config/mixbox.conf
Normal file
@@ -0,0 +1,21 @@
|
||||
#------------------【DMS】--------------------
|
||||
dms() {
|
||||
|
||||
eval `mbdb export dms`
|
||||
source "$(mbdb get mixbox.main.path)"/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
if [ "$enable" == '1' ]; then
|
||||
# Scripts Here
|
||||
readsh "请输入${appname}媒体目录" "path" "${mbdisk}"
|
||||
readsh "请输入${appname}媒体服务器名称" "servername" "mixbox-dms"
|
||||
# readsh "请输入${appname}外网访问配置[1/0]" "openport" "0"
|
||||
readsh "重启${appname}服务[1/0] " "res" "1"
|
||||
[ "$res" = '1' -o -z "$res" ] && ${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【DMS】--------------------
|
||||
68
apps/dms/scripts/dms.sh
Normal file
68
apps/dms/scripts/dms.sh
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/bin/sh
|
||||
#copyright by monlor
|
||||
eval `mbdb export dms`
|
||||
source "$(mbdb get mixbox.main.path)"/bin/base
|
||||
port=""
|
||||
|
||||
start() {
|
||||
|
||||
[ -n "$(pidof ${appname})" ] && logsh "【$service】" "${appname}已经在运行!" && exit 1
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
cru a "${appname}" "0 6 * * * ${mbroot}/apps/${appname}/scripts/${appname}.sh restart"
|
||||
# Scripts Here
|
||||
[ -z "$path" ] && echo "媒体目录不能为空!" && exit 1
|
||||
# open_port
|
||||
# write_firewall_start
|
||||
daemon ${mbroot}/apps/${appname}/bin/${appname} -path "${path}" -friendlyName "${servername}" -http "11338" -fFprobeCachePath "${mbdisk}/.dms-ffprobe-cache"
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!" && end
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
# logsh "【$service】" "请在浏览器打开地址:http://$lanip:$port"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
[ "$enable" == '0' ] && destroy
|
||||
# close_port
|
||||
# remove_firewall_start
|
||||
killall -9 ${appname} &> /dev/null
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
# End app, Scripts here
|
||||
cru d "${appname}"
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
end() {
|
||||
|
||||
mbdb set ${appname}.main.enable=0
|
||||
stop && exit 1
|
||||
|
||||
}
|
||||
|
||||
status() {
|
||||
|
||||
if [ -n "$(pidof ${appname})" ]; then
|
||||
status="运行中|1"
|
||||
else
|
||||
status="未运行|0"
|
||||
fi
|
||||
mbdb set ${appname}.main.status="$status"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) start ;;
|
||||
stop) stop ;;
|
||||
restart) stop; start ;;
|
||||
reload) close_port && open_port ;;
|
||||
status) status ;;
|
||||
esac
|
||||
|
||||
@@ -4,7 +4,7 @@ export PATH=$PATH:/etc/mixbox/bin
|
||||
|
||||
mburl_coding="https://monlor.coding.net/p/mbfiles/d/mbfiles/git/raw/master"
|
||||
mburl_github="https://cdn.jsdelivr.net/gh/monlor/mbfiles"
|
||||
mburl_test="https://monlor.coding.net/p/mbfiles/d/mbfiles/git/raw/test"
|
||||
# mburl_test="https://monlor.coding.net/p/mbfiles/d/mbfiles/git/raw/test"
|
||||
mburl=$(mbdb get mixbox.main.url) || mburl="$mburl_coding"
|
||||
mbroot=$(mbdb get mixbox.main.path)
|
||||
mbdisk=$(mbdb get mixbox.main.mbdisk)
|
||||
|
||||
@@ -170,20 +170,20 @@ modify_source() {
|
||||
case "$mburl" in
|
||||
"$mburl_coding") url_text="coding下载源" ;;
|
||||
"$mburl_github") url_text="github下载源" ;;
|
||||
"$mburl_test") url_text="coding测试源" ;;
|
||||
# "$mburl_test") url_text="coding测试源" ;;
|
||||
*) url_text="$mburl" ;;
|
||||
esac
|
||||
echo "下载源【$url_text】使用中"
|
||||
echo "0. 不修改"
|
||||
echo "1. coding下载源"
|
||||
echo "2. github下载源"
|
||||
echo "3. coding测试源(不推荐)"
|
||||
# echo "3. coding测试源(不推荐)"
|
||||
read -p "请选择或输入下载源:" res
|
||||
case "$res" in
|
||||
0) return ;;
|
||||
1) mburl_tmp="$mburl_coding" ;;
|
||||
2) mburl_tmp="$mburl_github" ;;
|
||||
3) mburl_tmp="$mburl_test" ;;
|
||||
# 3) mburl_tmp="$mburl_test" ;;
|
||||
*) [ -n "$res" ] && mburl_tmp="$res" ;;
|
||||
esac
|
||||
if [ -n "$mburl_tmp" ]; then
|
||||
|
||||
@@ -21,6 +21,7 @@ backupfiles=""
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_linux_x86_64"
|
||||
appinfo="${appinfo}"
|
||||
newinfo=""
|
||||
version="0.0.1"
|
||||
EOF
|
||||
echo "生成工具箱配置文件..."
|
||||
cat > ${appname}/config/mixbox.conf <<EOF
|
||||
|
||||
Reference in New Issue
Block a user