🤞 Sync 2026-04-23 06:19:46

This commit is contained in:
github-actions[bot] committed 2026-04-23 06:19:46 +08:00
1 parent a1df15cd3d
commit b86d032e91
250 files changed
+41507 -188

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=report
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/report
include $(INCLUDE_DIR)/package.mk
define Package/report
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Generate report
DEPENDS:=
endef
define Package/report/description
Utility to generate report
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/report/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) ./files/report $(1)/bin/
$(INSTALL_DIR) $(1)/etc/config
$(CP) ./files/report.config $(1)/etc/config/report
endef
$(eval $(call BuildPackage,report))
+65
View File
@@ -0,0 +1,65 @@
#!/bin/sh
mkdir /tmp/report
cp /etc/openwrt_release /tmp/report/openwrt_release.txt
if [[ "$(uci -q get report.@report[0].kernel)" -eq "1" ]]; then
dmesg &> /tmp/report/dmesg.txt
fi
if [[ "$(uci -q get report.@report[0].system)" -eq "1" ]]; then
logread &> /tmp/report/logread.txt
log_file=$(uci -q get system.@system[0].log_file)
if [[ -n "$log_file" ]]; then
cp ${log_file} /tmp/report/logfile.txt
cp ${log_file}.old /tmp/report/logfile.old.txt
fi
fi
if [[ "$(uci -q get report.@report[0].network)" -eq "1" ]]; then
cp /etc/config/network /tmp/report/network.txt
cp /etc/config/firewall /tmp/report/firewall.txt
cp /etc/config/wireless /tmp/report/wireless.txt
route -n &> /tmp/report/route.txt
ifconfig &> /tmp/report/ifconfig.txt
iptables -S &> /tmp/report/iptables.txt
fi
if [[ "$(uci -q get report.@report[0].simman)" -eq "1" ]]; then
cp /etc/config/simman2 /tmp/report/simman2.txt
simman2_cli -a core &> /tmp/report/simman2_cli.txt
fi
if [[ "$(uci -q get report.@report[0].openvpn)" -eq "1" ]]; then
cp /etc/config/openvpn /tmp/report/openvpn.txt
fi
if [[ "$(uci -q get report.@report[0].mwan)" -eq "1" ]]; then
cp /etc/config/mwan3 /tmp/report/mwan.txt
fi
if [[ "$(uci -q get report.@report[0].pollmydevice)" -eq "1" ]]; then
cp /etc/config/pollmydevice /tmp/report/pollmydevice.txt
fi
if [[ "$(uci -q get report.@report[0].ntp)" -eq "1" ]]; then
ntpq -p &> /tmp/report/ntpqp.txt
cp /etc/ntp.conf /tmp/report/ntp.txt
fi
if [[ "$(uci -q get report.@report[0].smsd)" -eq "1" ]]; then
cp /etc/config/smscontrol /tmp/report/smscontrol.txt
cp /etc/smsd.conf /tmp/report/smsd.txt
cp /var/log/smsd.log /tmp/report/smsdlog.txt
fi
if [[ "$(uci -q get report.@report[0].snmp)" -eq "1" ]]; then
cp /etc/config/snmpd /tmp/report/snmpd.txt
fi
cd /tmp/ && tar -czf /tmp/report.tar.gz report 2>/dev/null
rm -rf /tmp/report/
exit 0
+11
View File
@@ -0,0 +1,11 @@
config report
option kernel '1'
option system '1'
option network '1'
option openvpn '1'
option ntp '1'
option snmp '1'
option simman '1'
option mwan '1'
option pollmydevice '1'
option smsd '1'