luci app vlmcsd: update to fit new luci

This commit is contained in:
coolsnowwolf 2019-04-24 13:49:35 +08:00
parent a776110414
commit 30d7a4cadf
4 changed files with 6 additions and 8 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI page for KMS
LUCI_DEPENDS:=+vlmcsd
PKG_VERSION:=1.0
PKG_RELEASE:=3
PKG_RELEASE:=5
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -13,7 +13,7 @@ end
function act_status()
local e={}
e.running=nixio.fs.access("/var/run/vlmcsd.pid")
e.running=luci.sys.call("pgrep vlmcsd >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -1,7 +1,6 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2011-2015 OpenWrt.org
PIDFILE=/var/run/vlmcsd.pid
START=90
get_config() {
@ -30,7 +29,7 @@ start() {
config_load vlmcsd
config_foreach get_config vlmcsd
[ $enabled -eq 0 ] && exit 0
/usr/bin/vlmcsd -i /etc/vlmcsd.ini -L 0.0.0.0:1688 -p $PIDFILE
/usr/bin/vlmcsd -i /etc/vlmcsd.ini -L 0.0.0.0:1688
echo "KMS Server has started."
if [ $autoactivate -eq 1 ]; then
@ -51,8 +50,7 @@ start() {
}
stop() {
pid=`cat $PIDFILE`
kill $pid || kill -9 $pid
echo "KMS Server has stopped."
killall -q -9 vlmcsd
echo "KMS Server has stopped."
}

View File

@ -3,7 +3,7 @@
uci -q batch <<-EOF >/dev/null
delete ucitrack.@vlmcsd[-1]
add ucitrack vlmcsd
set ucitrack.@vlmcsd[-1].init=vlmcsd
set ucitrack.@vlmcsd[-1].init=kms
commit ucitrack
EOF