mirror of
https://github.com/monlor/MIXBOX-ARCHIVE.git
synced 2026-03-10 23:41:27 +00:00
moxbox init
This commit is contained in:
BIN
apps/kms/bin/kms_darwin_x86_64
Normal file
BIN
apps/kms/bin/kms_darwin_x86_64
Normal file
Binary file not shown.
BIN
apps/kms/bin/kms_linux_arm
Normal file
BIN
apps/kms/bin/kms_linux_arm
Normal file
Binary file not shown.
BIN
apps/kms/bin/kms_linux_mips
Normal file
BIN
apps/kms/bin/kms_linux_mips
Normal file
Binary file not shown.
BIN
apps/kms/bin/kms_linux_x86_64
Normal file
BIN
apps/kms/bin/kms_linux_x86_64
Normal file
Binary file not shown.
7
apps/kms/config/kms.uci
Normal file
7
apps/kms/config/kms.uci
Normal file
@@ -0,0 +1,7 @@
|
||||
service="Kms"
|
||||
appname="kms"
|
||||
needver="0.0.1"
|
||||
supports="linux_arm,linux_mips,linux_x86_64,darwin_x86_64"
|
||||
appinfo="快速搭建Windows、Office激活服务器"
|
||||
newinfo="Support for Windows 10 1809, Windows Server 2019 and Office 2019 built-in"
|
||||
version="0.0.2"
|
||||
19
apps/kms/config/mixbox.conf
Normal file
19
apps/kms/config/mixbox.conf
Normal file
@@ -0,0 +1,19 @@
|
||||
#------------------【Kms】--------------------
|
||||
kms() {
|
||||
|
||||
eval `mbdb export kms`
|
||||
source /etc/mixbox/bin/base
|
||||
source /etc/mixbox/bin/base
|
||||
echo "********* $service ***********"
|
||||
echo "[${appinfo}]"
|
||||
readsh "启动${appname}服务[1/0] " "enable" "1"
|
||||
|
||||
if [ "$enable" == '1' ]; then
|
||||
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
|
||||
else
|
||||
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
|
||||
fi
|
||||
|
||||
}
|
||||
#------------------【Kms】--------------------
|
||||
1
apps/kms/config/version.txt
Normal file
1
apps/kms/config/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
1.1.5
|
||||
67
apps/kms/scripts/kms.sh
Normal file
67
apps/kms/scripts/kms.sh
Normal file
@@ -0,0 +1,67 @@
|
||||
#!/bin/sh
|
||||
source /etc/mixbox/bin/base
|
||||
eval `mbdb export kms`
|
||||
|
||||
port=1688
|
||||
|
||||
|
||||
set_config() {
|
||||
|
||||
echo -e "srv-host=_vlmcs._tcp,XiaoQiang,1688,0,100\ndomain=lan" > /tmp/etc/dnsmasq.d/kms.conf
|
||||
/etc/init.d/dnsmasq reload
|
||||
|
||||
}
|
||||
|
||||
start () {
|
||||
|
||||
result=$(ps | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" != '0' ];then
|
||||
logsh "【$service】" "${appname}已经在运行!"
|
||||
exit 1
|
||||
fi
|
||||
logsh "【$service】" "正在启动${appname}服务... "
|
||||
|
||||
set_config
|
||||
|
||||
open_port
|
||||
write_firewall_start
|
||||
daemon ${mbroot}/apps/${appname}/bin/${appname} -l ${mbroot}/var/log/${appname}.log
|
||||
if [ $? -ne 0 ]; then
|
||||
logsh "【$service】" "启动${appname}服务失败!"
|
||||
else
|
||||
logsh "【$service】" "启动${appname}服务完成!"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop () {
|
||||
|
||||
logsh "【$service】" "正在停止${appname}服务... "
|
||||
close_port
|
||||
remove_firewall_start
|
||||
killall -9 ${appname} &> /dev/null
|
||||
rm -rf /tmp/etc/dnsmasq.d/kms.conf
|
||||
|
||||
}
|
||||
|
||||
|
||||
status() {
|
||||
|
||||
result=$(pssh | grep ${mbroot}/apps/${appname}/bin/${appname} | grep -v grep | wc -l)
|
||||
if [ "$result" == '0' ]; then
|
||||
status="未运行|0"
|
||||
else
|
||||
status="运行端口号: ${port}|1"
|
||||
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