diff --git a/adguardhome/Makefile b/adguardhome/Makefile index 8ea64b42d..ea9643aba 100644 --- a/adguardhome/Makefile +++ b/adguardhome/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adguardhome PKG_VERSION:=0.107.0-b.11 -PKG_RELEASE:= +PKG_RELEASE:=9 PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=fea76816dffa8f576c3cd814c967d2f77675877b diff --git a/aliyundrive-webdav/Makefile b/aliyundrive-webdav/Makefile index 11b780373..f563266db 100644 --- a/aliyundrive-webdav/Makefile +++ b/aliyundrive-webdav/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=aliyundrive-webdav -PKG_VERSION:=0.1.27 +PKG_VERSION:=0.2.0 PKG_RELEASE:=1 PKG_LICENSE:=MIT diff --git a/aliyundrive-webdav/files/aliyundrive-webdav.config b/aliyundrive-webdav/files/aliyundrive-webdav.config index 534d31cde..74248f63e 100644 --- a/aliyundrive-webdav/files/aliyundrive-webdav.config +++ b/aliyundrive-webdav/files/aliyundrive-webdav.config @@ -8,3 +8,4 @@ config server option auth_password '' option read_buffer_size '10485760' option cache_size '1000' + option root '/' diff --git a/aliyundrive-webdav/files/aliyundrive-webdav.init b/aliyundrive-webdav/files/aliyundrive-webdav.init index 7fd532cd7..4750d9aae 100755 --- a/aliyundrive-webdav/files/aliyundrive-webdav.init +++ b/aliyundrive-webdav/files/aliyundrive-webdav.init @@ -23,9 +23,10 @@ start_service() { local cache_size=$(uci_get_by_type server cache_size 1000) local host=$(uci_get_by_type server host 127.0.0.1) local port=$(uci_get_by_type server port 8080) + local root=$(uci_get_by_type server root /) procd_open_instance - procd_set_param command /bin/sh -c "/usr/bin/$NAME -I --host $host --port $port -S $read_buf_size --cache-size $cache_size >>/var/log/$NAME.log 2>&1" + procd_set_param command /bin/sh -c "/usr/bin/$NAME -I --host $host --port $port --root $root -S $read_buf_size --cache-size $cache_size >>/var/log/$NAME.log 2>&1" procd_set_param pidfile /var/run/$NAME.pid procd_set_param env REFRESH_TOKEN="$refresh_token" [[ ! -z "$auth_user" ]] && procd_append_param env WEBDAV_AUTH_USER="$auth_user" diff --git a/luci-app-aliyundrive-webdav/Makefile b/luci-app-aliyundrive-webdav/Makefile index 132e56314..218673981 100644 --- a/luci-app-aliyundrive-webdav/Makefile +++ b/luci-app-aliyundrive-webdav/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-aliyundrive-webdav -PKG_VERSION:=0.1.27 +PKG_VERSION:=0.2.0 PKG_RELEASE:=1 PKG_PO_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) diff --git a/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua b/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua index d5e9b5528..adace8ec2 100644 --- a/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua +++ b/luci-app-aliyundrive-webdav/luasrc/model/cbi/aliyundrive-webdav/client.lua @@ -13,6 +13,9 @@ enable.rmempty = false refresh_token = e:option(Value, "refresh_token", translate("Refresh Token")) +root = e:option(Value, "root", translate("Root Directory")) +root.default = "/" + host = e:option(Value, "host", translate("Host")) host.default = "0.0.0.0" host.datatype = "ipaddr" diff --git a/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po b/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po index a96a9e3e2..091f3385a 100644 --- a/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po +++ b/luci-app-aliyundrive-webdav/po/zh-cn/aliyundrive-webdav.po @@ -13,6 +13,9 @@ msgstr "启用" msgid "Refresh Token" msgstr "Refresh Token" +msgid "Root Directory" +msgstr "根目录" + msgid "Host" msgstr "监听主机" diff --git a/luci-app-serverchan/luasrc/model/cbi/serverchan/advanced.lua b/luci-app-serverchan/luasrc/model/cbi/serverchan/advanced.lua index 4858600bd..704953db7 100644 --- a/luci-app-serverchan/luasrc/model/cbi/serverchan/advanced.lua +++ b/luci-app-serverchan/luasrc/model/cbi/serverchan/advanced.lua @@ -32,12 +32,18 @@ a=s:option(Value, "soc_code", "自定义温度读取命令") a.rmempty = true a:value("",translate("默认")) a:value("pve",translate("PVE 虚拟机")) -a.description = translate("请尽量避免使用特殊符号,如双引号、$、!等,执行结果需为数字,用于温度对比") +a.description = translate("自定义命令如需使用特殊符号,如引号、$、!等,则需要自行转义,并在保存后查看 /etc/config/serverchan 文件 soc_code 设置项是否保存正确
可以使用 eval `echo $(uci get serverchan.serverchan.soc_code)` 命令查看命令输出及错误信息
执行结果需为纯数字(可带小数),用于温度对比") a=s:option(Value,"server_host",translate("宿主机地址")) a.rmempty=true a.default="10.0.0.2" -a.description = translate("请确认已经设置好密钥登陆,否则会引起脚本无法运行等错误!
PVE 安装 sensors 命令自行百度
密钥登陆例:
opkg update #更新列表
opkg install openssh-client openssh-keygen #安装openssh客户端
ssh-keygen -t rsa # 生成密钥文件(自行设定密码等信息)
ssh root@10.0.0.2 \"tee -a ~/.ssh/id_rsa.pub\" < ~/.ssh/id_rsa.pub # 传送公钥到 PVE
ssh root@10.0.0.2 \"cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys\" # 写入公钥到 PVE
ssh -i ~/.ssh/id_rsa root@10.0.0.2 sensors # 测试温度命令") +a.description = translate("") +a:depends({soc_code="pve"}) + +a=s:option(Value,"server_port",translate("宿主机 SSH 端口")) +a.rmempty=true +a.default="22" +a.description = translate("SSH 端口默认为 22,如有自定义,请填写自定义 SSH 端口
请确认已经设置好密钥登陆,否则会引起脚本无法运行等错误!
PVE 安装 sensors 命令自行百度
密钥登陆例(自行修改地址与端口号):
opkg update #更新列表
opkg install openssh-client openssh-keygen #安装openssh客户端
ssh-keygen -t rsa # 生成密钥文件(自行设定密码等信息)
ssh root@10.0.0.2 -p 22 \"tee -a ~/.ssh/id_rsa.pub\" < ~/.ssh/id_rsa.pub # 传送公钥到 PVE
ssh root@10.0.0.2 -p 22 \"cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys\" # 写入公钥到 PVE
ssh -i ~/.ssh/id_rsa root@10.0.0.2 -p 22 sensors # 使用私钥连接 PVE 测试温度命令") a:depends({soc_code="pve"}) a=s:option(Button,"soc",translate("测试温度命令")) diff --git a/luci-app-serverchan/root/usr/bin/serverchan/serverchan b/luci-app-serverchan/root/usr/bin/serverchan/serverchan index 48e430131..be7122e33 100755 --- a/luci-app-serverchan/root/usr/bin/serverchan/serverchan +++ b/luci-app-serverchan/root/usr/bin/serverchan/serverchan @@ -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" "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" \ + "up_timeout" "down_timeout" "timeout_retry_count" "thread_num" "soc_code" "server_host" "server_port" "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 @@ -41,6 +41,7 @@ function read_config(){ [ -z "$up_timeout" ] || [ "$up_timeout" -eq "0" ] && up_timeout="2" [ -z "$down_timeout" ] || [ "$down_timeout" -eq "0" ] && down_timeout="20";down_timeout=`expr ${down_timeout} / 2 + 1` [ -z "$timeout_retry_count" ] && timeout_retry_count="2";[ "$timeout_retry_count" -eq "0" ] && timeout_retry_count="1" + [ -z "$server_port" ] && server_port="22" str_title_start=`/usr/bin/jq -r '.str_title_start' ${jsonpath}` str_title_end=`/usr/bin/jq -r '.str_title_end' ${jsonpath}` str_linefeed=`/usr/bin/jq -r '.str_linefeed' ${jsonpath}` @@ -247,7 +248,7 @@ 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` + [ "$soc_code" == "pve" ] && [ ! -z "$server_host" ] && local soctemp=`ssh -i ~/.ssh/id_rsa root@${server_host} -p ${server_port} sensors 2>/dev/null|grep °C|sed -nr 's#^.*:.*\+(.*)°C .*#\1#gp'|sort -nr|head -n1` [ ! -z "$soctemp" ] && echo "$soctemp" && return [ ! -z "$soc_code" ] && eval `echo "$soc_code"` 2>/dev/null } @@ -1104,11 +1105,18 @@ function send(){ local systemload=`cat /proc/loadavg|awk '{print $1" "$2" "$3}'` local cpuload=`getcpu` local ramload=`free -m|sed -n '2p'|awk '{printf "%.2f%%\n",($3/$2)*100}'` + local Qwai=`curl -o /dev/null --connect-timeout 5 -s -w %{http_code} www.google.com` + if [[ "$Qwai" -eq "200" ]] || [[ "$Qwai" -eq "301" ]] || [[ "$Qwai" -eq "302" ]]; then + local Qwai_status="已连通!" + else + local Qwai_status="已断开!" + fi local systemstatustime=`cat /proc/uptime|awk -F. '{run_days=$1 / 86400;run_hour=($1 % 86400)/3600;run_minute=($1 % 3600)/60;run_second=$1 % 60;printf("运行时间:%d天%d时%d分%d秒",run_days,run_hour,run_minute,run_second)}'`;unset run_days run_hour run_minute run_second local send_content="${send_content}${str_splitline}${str_title_start} 系统运行状态${str_title_end}" local send_content="${send_content}${str_linefeed}${str_tab}平均负载:${systemload}" local send_content="${send_content}${str_linefeed}${str_tab}CPU占用:${cpuload}" local send_content="${send_content}${str_linefeed}${str_tab}内存占用:${ramload}" + local send_content="${send_content}${str_linefeed}${str_tab}全球互联:${Qwai_status}" local send_content="${send_content}${str_linefeed}${str_tab}${systemstatustime}" fi