mirror of
https://github.com/monlor/MIXBOX-ARCHIVE.git
synced 2026-03-10 23:41:27 +00:00
@@ -154,6 +154,7 @@ mixbox help
|
|||||||
28. [SSServer]
|
28. [SSServer]
|
||||||
29. [Transmission]
|
29. [Transmission]
|
||||||
30. [WebD]
|
30. [WebD]
|
||||||
|
31. [ttyd](https://github.com/tsl0922/ttyd)
|
||||||
|
|
||||||
### 快速制作插件
|
### 快速制作插件
|
||||||
|
|
||||||
@@ -177,6 +178,3 @@ mixbox help
|
|||||||
| 微信 | 支付宝 |
|
| 微信 | 支付宝 |
|
||||||
| :----------------------------------------------------------: | :----------------------------------------------------------: |
|
| :----------------------------------------------------------: | :----------------------------------------------------------: |
|
||||||
|  |  |
|
|  |  |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
apps/ttyd/bin/ttyd_linux_aarch64
Normal file
BIN
apps/ttyd/bin/ttyd_linux_aarch64
Normal file
Binary file not shown.
BIN
apps/ttyd/bin/ttyd_linux_arm
Normal file
BIN
apps/ttyd/bin/ttyd_linux_arm
Normal file
Binary file not shown.
BIN
apps/ttyd/bin/ttyd_linux_mips
Normal file
BIN
apps/ttyd/bin/ttyd_linux_mips
Normal file
Binary file not shown.
BIN
apps/ttyd/bin/ttyd_linux_x86_64
Normal file
BIN
apps/ttyd/bin/ttyd_linux_x86_64
Normal file
Binary file not shown.
7
apps/ttyd/config/ttyd.uci
Normal file
7
apps/ttyd/config/ttyd.uci
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
service="ttyd"
|
||||||
|
appname="ttyd"
|
||||||
|
needver="0.0.1"
|
||||||
|
supports="linux_arm,linux_mips,linux_x86_64"
|
||||||
|
appinfo="网页ssh工具,可在网页上执行 shell"
|
||||||
|
newinfo=""
|
||||||
|
version="0.0.1"
|
||||||
17
apps/ttyd/scripts/config.sh
Normal file
17
apps/ttyd/scripts/config.sh
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#copyright by monlor
|
||||||
|
|
||||||
|
eval `mbdb export ttyd`
|
||||||
|
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}端口号" "port" "7681"
|
||||||
|
readsh "请输入${appname}外网访问配置[1/0]" "openport" "0"
|
||||||
|
readsh "重启${appname}服务[1/0] " "res" "1"
|
||||||
|
[ "$res" = '1' -o -z "$res" ] && return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
49
apps/ttyd/scripts/ttyd.sh
Normal file
49
apps/ttyd/scripts/ttyd.sh
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
source /etc/mixbox/bin/base
|
||||||
|
eval `mbdb export ttyd`
|
||||||
|
|
||||||
|
port=${port:-7681}
|
||||||
|
|
||||||
|
start () {
|
||||||
|
|
||||||
|
[ -n "$(pidof ${appname})" ] && logsh "【$service】" "${appname}已经在运行!" && exit 1
|
||||||
|
logsh "【$service】" "正在启动${appname}服务... "
|
||||||
|
open_port
|
||||||
|
write_firewall_start
|
||||||
|
daemon ${mbroot}/apps/${appname}/bin/${appname} -p ${port} ash
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
logsh "【$service】" "启动${appname}服务失败!"
|
||||||
|
else
|
||||||
|
logsh "【$service】" "启动${appname}服务完成!"
|
||||||
|
logsh "【$service】" "请在浏览器访问http://$lanip:${port}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
stop () {
|
||||||
|
|
||||||
|
logsh "【$service】" "正在停止${appname}服务... "
|
||||||
|
close_port
|
||||||
|
remove_firewall_start
|
||||||
|
killall -9 ${appname} &> /dev/null
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status() {
|
||||||
|
if pgrep -x "${mbroot}/apps/${appname}/bin/${appname}" >/dev/null; then
|
||||||
|
status="运行端口号: ${port}|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
|
||||||
Reference in New Issue
Block a user