update-09.18
This commit is contained in:
parent
77c8b79880
commit
6019d59118
|
@ -1,7 +1,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-serverchan
|
||||
PKG_VERSION:=2.01.3
|
||||
PKG_VERSION:=2.01.4
|
||||
PKG_RELEASE:=9
|
||||
|
||||
PKG_MAINTAINER:=tty228 <tty228@yeah.net>
|
||||
|
|
|
@ -31,8 +31,15 @@ a.datatype="uinteger"
|
|||
a=s:option(Value, "soc_code", "自定义温度读取命令")
|
||||
a.rmempty = true
|
||||
a:value("",translate("默认"))
|
||||
a:value("pve",translate("PVE 虚拟机"))
|
||||
a.description = translate("请尽量避免使用特殊符号,如双引号、$、!等,执行结果需为数字,用于温度对比")
|
||||
|
||||
a=s:option(Value,"server_host",translate("宿主机地址"))
|
||||
a.rmempty=true
|
||||
a.default="10.0.0.2"
|
||||
a.description = translate("请确认已经设置好密钥登陆,否则会引起脚本无法运行等错误!<br/>PVE 安装 sensors 命令自行百度<br/>密钥登陆例:<br/>opkg update #更新列表<br/>opkg install openssh-client openssh-keygen #安装openssh客户端<br/>ssh-keygen -t rsa # 生成密钥文件(自行设定密码等信息)<br/>ssh root@10.0.0.2 \"tee -a ~/.ssh/id_rsa.pub\" < ~/.ssh/id_rsa.pub # 传送公钥到 PVE<br/>ssh root@10.0.0.2 \"cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys\" # 写入公钥到 PVE<br/>ssh -i ~/.ssh/id_rsa root@10.0.0.2 sensors # 测试温度命令")
|
||||
a:depends({soc_code="pve"})
|
||||
|
||||
a=s:option(Button,"soc",translate("测试温度命令"))
|
||||
a.inputtitle = translate("输出信息")
|
||||
a.write = function()
|
||||
|
|
|
@ -14,7 +14,7 @@ function read_config(){
|
|||
"serverchan_ipv4" "ipv4_interface" "serverchan_ipv6" "ipv6_interface" "serverchan_up" "serverchan_down" "cpuload_enable" "cpuload" "temperature_enable" "temperature" "client_usage" "client_usage_max" "client_usage_disturb" "client_usage_whitelist" "web_logged" "ssh_logged" "web_login_failed" "ssh_login_failed" "login_max_num" "web_login_black" "ip_white_list" "ip_black_timeout"\
|
||||
"regular_time" "regular_time_2" "regular_time_3" "interval_time" \
|
||||
"serverchan_sheep" "starttime" "endtime" "serverchan_whitelist" "serverchan_blacklist" "serverchan_interface" "MAC_online_list" "MAC_offline_list" \
|
||||
"up_timeout" "down_timeout" "timeout_retry_count" "thread_num" "soc_code" "err_enable" "err_sheep_enable" "err_device_aliases" "network_err_event" "system_time_event" "autoreboot_time" "network_restart_time" "public_ip_event" "public_ip_retry_count" \
|
||||
"up_timeout" "down_timeout" "timeout_retry_count" "thread_num" "soc_code" "server_host" "err_enable" "err_sheep_enable" "err_device_aliases" "network_err_event" "system_time_event" "autoreboot_time" "network_restart_time" "public_ip_event" "public_ip_retry_count" \
|
||||
"jsonpath" "sckey" "corpid" "userid" "agentid" "corpsecret" "mediapath" "wxpusher_apptoken" "wxpusher_uids" "wxpusher_topicIds" "pushplus_token" "tg_token" "chat_id"
|
||||
|
||||
for str_version in "wrtbwmon" "iputils-arping" "curl" "iw"; do
|
||||
|
@ -247,8 +247,9 @@ function getcpu(){
|
|||
function soc_temp(){
|
||||
[ -z "$soc_code" ] && local soctemp=`sensors 2>/dev/null|grep °C|sed -nr 's#^.*:.*\+(.*)°C .*#\1#gp'|sort -nr|head -n1`
|
||||
[ -z "$soc_code" ] && [ -z "$soctemp" ] && local soctemp=`cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null|sort -nr|head -n1|cut -c-2`
|
||||
[ "$soc_code" == "pve" ] && [ ! -z "$server_host" ] && local soctemp=`ssh -i ~/.ssh/id_rsa root@${server_host} sensors 2>/dev/null|grep °C|sed -nr 's#^.*:.*\+(.*)°C .*#\1#gp'|sort -nr|head -n1`
|
||||
[ ! -z "$soctemp" ] && echo "$soctemp" && return
|
||||
[ ! -z "$soc_code" ] && echo "$soc_code"|awk '{run=$0;system(run)}' 2>/dev/null
|
||||
[ ! -z "$soc_code" ] && eval `echo "$soc_code"` 2>/dev/null
|
||||
}
|
||||
|
||||
# 流量数据
|
||||
|
@ -882,7 +883,7 @@ function cpu_load(){
|
|||
local cpu_wendu=`soc_temp`;
|
||||
[ -z "$cpu_wendu" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】无法读取设备温度,请检查命令" >> ${logfile}
|
||||
|
||||
if [ "$cpu_wendu" -gt "$temperature" ]; then
|
||||
if [ `expr $cpu_wendu \> $temperature` -eq "1" ]; then
|
||||
echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!警报!!】 CPU 温度过高: ${cpu_wendu}" >> ${logfile}
|
||||
else
|
||||
temperature_time=`date +%s`
|
||||
|
|
|
@ -222,7 +222,7 @@ local function processData(szType, content)
|
|||
local password = userinfo:sub(userinfo:find(":") + 1, #userinfo)
|
||||
result.alias = UrlDecode(alias)
|
||||
result.type = v2_ss
|
||||
result.v2ray_protocol = "shadowsocks"
|
||||
result.password = password
|
||||
result.server = host[1]
|
||||
if host[2]:find("/%?") then
|
||||
local query = split(host[2], "/%?")
|
||||
|
@ -249,12 +249,14 @@ local function processData(szType, content)
|
|||
else
|
||||
result.server_port = host[2]:gsub("/","")
|
||||
end
|
||||
if checkTabValue(encrypt_methods_ss)[method] then
|
||||
result.encrypt_method_ss = method
|
||||
result.password = password
|
||||
else
|
||||
if not checkTabValue(encrypt_methods_ss)[method] then
|
||||
-- 1202 年了还不支持 SS AEAD 的屑机场
|
||||
result.server = nil
|
||||
elseif v2_ss == "v2ray" then
|
||||
result.v2ray_protocol = "shadowsocks"
|
||||
result.encrypt_method_v2ray_ss = method
|
||||
else
|
||||
result.encrypt_method_ss = method
|
||||
end
|
||||
elseif szType == "sip008" then
|
||||
result.type = v2_ss
|
||||
|
@ -262,12 +264,16 @@ local function processData(szType, content)
|
|||
result.server = content.server
|
||||
result.server_port = content.server_port
|
||||
result.password = content.password
|
||||
result.encrypt_method_ss = content.method
|
||||
result.plugin = content.plugin
|
||||
result.plugin_opts = content.plugin_opts
|
||||
result.alias = content.remarks
|
||||
if not checkTabValue(encrypt_methods_ss)[content.method] then
|
||||
result.server = nil
|
||||
elseif v2_ss == "v2ray" then
|
||||
result.v2ray_protocol = "shadowsocks"
|
||||
result.encrypt_method_v2ray_ss = content.method
|
||||
else
|
||||
result.encrypt_method_ss = content.method
|
||||
end
|
||||
elseif szType == "ssd" then
|
||||
result.type = v2_ss
|
||||
|
@ -275,14 +281,20 @@ local function processData(szType, content)
|
|||
result.server = content.server
|
||||
result.server_port = content.port
|
||||
result.password = content.password
|
||||
result.encrypt_method_ss = content.encryption
|
||||
result.plugin = content.plugin
|
||||
result.plugin_opts = content.plugin_options
|
||||
result.alias = "[" .. content.airport .. "] " .. content.remarks
|
||||
if checkTabValue(encrypt_methods_ss)[result.encrypt_method_ss] then
|
||||
result.server = nil
|
||||
elseif result.plugin == "simple-obfs" then
|
||||
if content.plugin == "simple-obfs" then
|
||||
result.plugin = "obfs-local"
|
||||
else
|
||||
result.plugin = content.plugin
|
||||
end
|
||||
if not checkTabValue(encrypt_methods_ss)[content.encryption] then
|
||||
result.server = nil
|
||||
elseif v2_ss == "v2ray" then
|
||||
result.v2ray_protocol = "shadowsocks"
|
||||
result.encrypt_method_v2ray_ss = content.method
|
||||
else
|
||||
result.encrypt_method_ss = content.method
|
||||
end
|
||||
elseif szType == "trojan" then
|
||||
local idx_sp = 0
|
||||
|
|
Loading…
Reference in New Issue