Merge Lean's source

This commit is contained in:
CN_SZTL 2020-03-27 16:25:34 +08:00
commit fa848d0975
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
3 changed files with 4 additions and 6 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=autocore
PKG_VERSION:=1
PKG_RELEASE:=30
PKG_RELEASE:=31
include $(INCLUDE_DIR)/package.mk

View File

@ -50,11 +50,9 @@
local eth_info = luci.sys.exec("ethinfo")
local user_info = tonumber(luci.sys.exec("cat /proc/net/arp | grep '0x2' | wc -l")) or 0
local user_info = luci.sys.exec("cat /proc/net/arp | grep '0x2' | wc -l") or 0
local cpu_usage = fs.readfile("/tmp/cpuusage") or "6.6%"
luci.sys.exec("/sbin/getcpu &")
local cpu_usage = (luci.sys.exec("expr 100 - $(top -n 1 | grep 'CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}')") or "6") .. "%"
local rv = {
cpuusage = cpu_usage,

View File

@ -67,7 +67,7 @@ check_host() {
add_cron() {
sed -i '/shadowsocksr/d' $CRON_FILE
sed -i '/ssrplus.log/d' $CRON_FILE && echo '0 1 * * * echo "" > /tmp/ssrplus.log' >>$CRON_FILE
[ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 $(uci_get_by_type server_subscribe auto_update_time) * * * /usr/share/shadowsocksr/ssrplusupdate.sh" >>$CRON_FILE
[ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 $(uci_get_by_type server_subscribe auto_update_time) * * * /usr/share/shadowsocksr/ssrplusupdate.sh >> /tmp/ssrplus.log 2>&1" >>$CRON_FILE
crontab $CRON_FILE
}