luci-app-unblockmusic: add deamon monitor process

This commit is contained in:
lean 2019-10-30 15:54:07 +08:00
parent 700739398d
commit 61964b6aa5
2 changed files with 8 additions and 3 deletions

View File

@ -11,12 +11,12 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-unblockmusic
PKG_VERSION:=2.2.0
PKG_RELEASE:=8
PKG_RELEASE:=9
PKG_LICENSE:=Apache-2.0
LUCI_TITLE:=LuCI support for Unblock NeteaseCloudMusic
LUCI_DEPENDS:=+UnblockNeteaseMusic +bash +dnsmasq-full +ipset +bash
LUCI_DEPENDS:=+UnblockNeteaseMusic +bash +dnsmasq-full +ipset
LUCI_PKGARCH:=all
PKG_MAINTAINER:=lean

View File

@ -1,10 +1,15 @@
#!/bin/bash
log_max_size="4" #使用KB计算
log_max_size="10" #使用KB计算
log_file="/tmp/unblockmusic.log"
while true
do
sleep 10s
icount=`busybox ps -w | grep app.js |grep -v grep| wc -l`
if [ $icount -ne 2 ] ;then
/etc/init.d/unblockmusic restart
fi
(( log_size = "$(ls -l "${log_file}" | awk -F ' ' '{print $5}')" / "1024" ))
(( "${log_size}" >= "${log_max_size}" )) && echo "" > /tmp/unblockmusic.log
sleep 10m