From d3c476ed6b826b35f172473cb1d802cc2e0a015a Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Tue, 11 Feb 2020 20:42:12 +0800 Subject: [PATCH] luci-app-smartinfo: delete package --- CONTRIBUTED.md | 1 - package/ctcgfw/luci-app-smartinfo/Makefile | 16 -- .../luasrc/controller/smartinfo.lua | 132 --------------- .../luasrc/model/cbi/smartinfo.lua | 84 ---------- .../view/admin_status/index/smartinfo.htm | 1 - .../view/smartinfo/detail_begin_flag.htm | 10 -- .../view/smartinfo/detail_begin_value.htm | 7 - .../view/smartinfo/detail_end_listvalue.htm | 20 --- .../view/smartinfo/detail_end_value.htm | 9 - .../luasrc/view/smartinfo/smart_detail.htm | 82 ---------- .../luasrc/view/smartinfo/smart_status.htm | 80 --------- .../po/zh_Hans/smartinfo.po | 154 ------------------ .../root/etc/config/smartinfo | 11 -- .../root/etc/init.d/smartinfo | 15 -- .../root/usr/lib/smartinfo/smart_checker.sh | 113 ------------- .../root/usr/lib/smartinfo/smart_functions.sh | 56 ------- .../root/usr/lib/smartinfo/smart_status.sh | 17 -- 17 files changed, 808 deletions(-) delete mode 100644 package/ctcgfw/luci-app-smartinfo/Makefile delete mode 100644 package/ctcgfw/luci-app-smartinfo/luasrc/controller/smartinfo.lua delete mode 100644 package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua delete mode 100644 package/ctcgfw/luci-app-smartinfo/luasrc/view/admin_status/index/smartinfo.htm delete mode 100644 package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_begin_flag.htm delete mode 100644 package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_begin_value.htm delete mode 100644 package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_end_listvalue.htm delete mode 100644 package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_end_value.htm delete mode 100644 package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm delete mode 100644 package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm delete mode 100644 package/ctcgfw/luci-app-smartinfo/po/zh_Hans/smartinfo.po delete mode 100644 package/ctcgfw/luci-app-smartinfo/root/etc/config/smartinfo delete mode 100755 package/ctcgfw/luci-app-smartinfo/root/etc/init.d/smartinfo delete mode 100755 package/ctcgfw/luci-app-smartinfo/root/usr/lib/smartinfo/smart_checker.sh delete mode 100755 package/ctcgfw/luci-app-smartinfo/root/usr/lib/smartinfo/smart_functions.sh delete mode 100755 package/ctcgfw/luci-app-smartinfo/root/usr/lib/smartinfo/smart_status.sh diff --git a/CONTRIBUTED.md b/CONTRIBUTED.md index f0d607631a..42b5189586 100644 --- a/CONTRIBUTED.md +++ b/CONTRIBUTED.md @@ -5,7 +5,6 @@ Package jsda: [jsda/packages2](https://github.com/jsda/packages2).
luci-app-serverchan source: [tty228/luci-app-serverchan](https://github.com/tty228/luci-app-serverchan).
OpenAppFilter source: [destan19/OpenAppFilter](https://github.com/destan19/OpenAppFilter).
-luci-app-smartinfo source: [animefansxj/luci-app-smartinfo](https://github.com/animefansxj/luci-app-smartinfo).
luci-app-koolproxy source: [Baozisoftware/luci-app-koolproxy](https://github.com/Baozisoftware/luci-app-koolproxy).
luci-app-k3screenctrl source: [Hill-98/luci-app-k3screenctrl](https://github.com/Hill-98/luci-app-k3screenctrl).
luci-app-smstool source: [f8q8/luci-app-smstool-master](https://github.com/f8q8/luci-app-smstool-master).
diff --git a/package/ctcgfw/luci-app-smartinfo/Makefile b/package/ctcgfw/luci-app-smartinfo/Makefile deleted file mode 100644 index 93852d82f2..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (C) 2016 Openwrt.org -# -# This is free software, licensed under the Apache License, Version 2.0 . -# - -include $(TOPDIR)/rules.mk - -LUCI_TITLE:=LuCI support for Smartinfo -LUCI_DEPENDS:=+smartmontools -LUCI_PKGARCH:=all -PKG_VERSION:=3.2 -PKG_RELEASE:=1 - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature diff --git a/package/ctcgfw/luci-app-smartinfo/luasrc/controller/smartinfo.lua b/package/ctcgfw/luci-app-smartinfo/luasrc/controller/smartinfo.lua deleted file mode 100644 index f78fbb75ae..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/luasrc/controller/smartinfo.lua +++ /dev/null @@ -1,132 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - smartctl support - -Script by animefans_xj @ nvacg.org (af_xj@hotmail.com , xujun@smm.cn) - -Licensed under the GNU GPL License, Version 3 (the "license"); -you may not use this file except in compliance with the License. -you may obtain a copy of the License at - - http://www.gnu.org/licenses/gpl.txt - -$Id$ -]]-- - - -module("luci.controller.smartinfo",package.seeall) - -function index() - require("luci.i18n") - luci.i18n.loadc("smartinfo") - if not nixio.fs.access("/etc/config/smartinfo") then - return - end - - local page = entry({"admin","services","smartinfo"},cbi("smartinfo"),_("S.M.A.R.T Info")) - page.i18n="smartinfo" - page.dependent=true - entry({"admin","services","smartinfo","smartdetail"},call("smart_detail")).leaf = true - - entry({"admin","services","smartinfo","status"}, call("smart_status")).leaf = true - entry({"admin","services","smartinfo","run"},call("run_smart")).leaf=true - entry({"admin","services","smartinfo","smartattr"},call("smart_attr")).leaf=true - -end - - -function smart_status() - local cmd = io.popen("/usr/lib/smartinfo/smart_status.sh") - if cmd then - local dev = { } - while true do - local ln = cmd:read("*l") - if not ln then - break - elseif ln:match("^/%l+/%l+:%a+") then - local name,status = ln:match("^/%l+/(%l+):(%a+)") - local model,size - - if (status=="OK" or status=="Failed" or status=="Unsupported") then - model="%s %s" % {nixio.fs.readfile("/sys/class/block/%s/device/vendor" % name), nixio.fs.readfile("/sys/class/block/%s/device/model" % name)} - local s = tonumber((nixio.fs.readfile("/sys/class/block/%s/size" % name))) - size = "%s MB" % {s and math.floor(s / 2048)} - else - model="Unavailabled" - size="Unavailabled" - end - - if name and status then - dev[#dev+1]= { - name = name, - model = model, - size = size, - status = status - } - end - else - - end - end - - cmd:close() - luci.http.prepare_content("application/json") - luci.http.write_json(dev) - end -end - -function run_smart(dev) - local cmd = io.popen("smartctl --attributes -d sat /dev/%s" % dev) - if cmd then - local report = {} - local ln = cmd:read("*all") - report = { - out = ln - } - cmd:close() - luci.http.prepare_content("application/json") - luci.http.write_json(report) - end -end - -function smart_detail(dev) - luci.template.render("smartinfo/smart_detail", {dev=dev}) -end - -function smart_attr(dev) - local cmd = io.popen("smartctl --attributes -d sat /dev/%s" % dev) - if cmd then - local attr = { } - while true do - local ln = cmd:read("*l") - if not ln then - break - elseif ln:match("^.*%d+%s+.+%s+.+%s+.+%s+.+%s+.+%s+.+%s+.+%s+.+%s+.+") then - local id,attrbute,flag,value,worst,thresh,type,updated,raw = ln:match("^%s*(%d+)%s+([%a%p]+)%s+(%w+)%s+(%d+)%s+(%d+)%s+(%d+)%s+([%a%p]+)%s+(%a+)%s+[%w%p]+%s+(.+)") - - id= "%x" % id - if not id:match("^%w%w") then - id = "0%s" % id - end - - attr[#attr+1]= { - id = id:upper(), - attrbute = attrbute, - flag = flag, - value = value, - worst = worst, - thresh = thresh, - type = type, - updated = updated, - raw = raw - } - else - - end - end - - cmd:close() - luci.http.prepare_content("application/json") - luci.http.write_json(attr) - end - -end diff --git a/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua b/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua deleted file mode 100644 index e4dfa576da..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua +++ /dev/null @@ -1,84 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - smartctl support - -Script by animefans_xj @ nvacg.org (af_xj@hotmail.com , xujun@smm.cn) - -Licensed under the GNU GPL License, Version 3 (the "license"); -you may not use this file except in compliance with the License. -you may obtain a copy of the License at - - http://www.gnu.org/licenses/gpl.txt - -$Id$ -]]-- - - -require("luci.sys") -require("luci.util") - -m=Map("smartinfo",translate("S.M.A.R.T Info"),translate("This widget allow you to monitor your storage devices which support S.M.A.R.T technology.")) - -s=m:section(TypedSection,"smartinfo",translate("S.M.A.R.T Report Settings")) -s.addremove=false -s.anonymous=true - -m:section(SimpleSection).template="smartinfo/smart_status" - -s:tab("general",translate("Global")) ---s:tab("detail",translate("Detail")) - -enable=s:taboption("general",Flag,"enabled",translate("Enabled")) -enable.rmempty=false -function enable.cfgvalue(self,section) - return luci.sys.init.enabled("smartinfo") and self.enabled or self.disabled -end -function enable.write(self,section,value) - if value == "1" then - luci.sys.call("/etc/init.d/smartinfo stop > /dev/null") - luci.sys.call("/etc/init.d/smartinfo enable > /dev/null") - luci.sys.call("/etc/init.d/smartinfo start > /dev/null") - else - luci.sys.call("/etc/init.d/smartinfo stop > /dev/null") - luci.sys.call("/etc/init.d/smartinfo disable > /dev/null") - end -end -check_interval=s:taboption("general",Value,"time_step",translate("Check Interval")) -check_interval.rmempty=false -check_interval.placeholder="1" -check_interval.datatype="range(1,60)" -check_interval.template="smartinfo/detail_begin_value" -time_unit=s:taboption("general",ListValue,"time_unit",translate("Unit")) -time_unit.rmempty=false -time_unit.template="smartinfo/detail_end_listvalue" -time_unit:value("minute",translate("Minutes")) -time_unit:value("hour",translate("Hours")) -time_unit:value("day",translate("Days")) -time_unit:value("week",translate("Weeks")) - -log_enable=s:taboption("general",Flag,"log_enabled",translate("Log to file")) -log_enable.template="smartinfo/detail_begin_flag" -log_enable.rmempty=false -log_path=s:taboption("general",Value,"log_path",translate("at")) -log_path.template="smartinfo/detail_end_value" -log_path.placeholder="/tmp/log" -log_path.rmempty=false - -touch_enable=s:taboption("general",Flag,"touch_enabled",translate("Touch a warning file when disk fail")) -touch_enable.template="smartinfo/detail_begin_flag" -touch_enable.rmempty=false -touch_path=s:taboption("general",Value,"touch_path",translate("at")) -touch_path.template="smartinfo/detail_end_value" -touch_path.placeholder="/tmp" -touch_path.rmempty=false - -devices=s:taboption("general",DynamicList,"device",translate("Devices to monitor")) -local device_name = nil -local device_model = nil -for d in nixio.fs.glob("/dev/sd?") do - device_name=nixio.fs.basename(d) - device_model="%s %s" % {nixio.fs.readfile("/sys/class/block/%s/device/vendor" % device_name), nixio.fs.readfile("/sys/class/block/%s/device/model" % device_name)} - devices:value(d, "%s: %s" % {device_name, device_model}) -end - - -return m diff --git a/package/ctcgfw/luci-app-smartinfo/luasrc/view/admin_status/index/smartinfo.htm b/package/ctcgfw/luci-app-smartinfo/luasrc/view/admin_status/index/smartinfo.htm deleted file mode 100644 index 8af75d1978..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/luasrc/view/admin_status/index/smartinfo.htm +++ /dev/null @@ -1 +0,0 @@ -<%+smartinfo/smart_status%> diff --git a/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_begin_flag.htm b/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_begin_flag.htm deleted file mode 100644 index e294a1b651..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_begin_flag.htm +++ /dev/null @@ -1,10 +0,0 @@ - - - /> -<%+cbi/valueheader%> - /> diff --git a/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_begin_value.htm b/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_begin_value.htm deleted file mode 100644 index edca5138bb..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_begin_value.htm +++ /dev/null @@ -1,7 +0,0 @@ - - -<%+cbi/valueheader%> - /> diff --git a/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_end_listvalue.htm b/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_end_listvalue.htm deleted file mode 100644 index 64bed99514..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_end_listvalue.htm +++ /dev/null @@ -1,20 +0,0 @@ - - -  -<% if self.widget == "select" then %> - -<% elseif self.widget == "radio" then - local c = 0 - for i, key in pairs(self.keylist) do - c = c + 1 -%> - /> - ><%=self.vallist[i]%> -<% if c == self.size then c = 0 %><% if self.orientation == "horizontal" then %> <% else %>
<% end %> -<% end end %> -<% end %> -<%+cbi/valuefooter%> diff --git a/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_end_value.htm b/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_end_value.htm deleted file mode 100644 index 79c092cfa6..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/detail_end_value.htm +++ /dev/null @@ -1,9 +0,0 @@ - - -   - <%= self.title %> - /> -<%+cbi/valuefooter%> diff --git a/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm b/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm deleted file mode 100644 index 77d44b47cb..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm +++ /dev/null @@ -1,82 +0,0 @@ - - - S.M.A.R.T detail of <%=dev%> - - - - - - - -
-
-
- <%:S.M.A.R.T Attrbutes%>: /dev/<%=dev%> - - - - - - - - - - - - - - - -
<%:ID%><%:Attrbute%><%:Flag%><%:Value%><%:Worst%><%:Thresh%><%:Type%><%:Updated%><%:Raw%>

<%:Collecting data...%>
-
-
-
- - \ No newline at end of file diff --git a/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm b/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm deleted file mode 100644 index 4cd526da2e..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm +++ /dev/null @@ -1,80 +0,0 @@ - - - - -
- <%:S.M.A.R.T Status%> - - - - - - - - - - - -
<%:Device%><%:Model%><%:Size%><%:Status%><%:Detail%>

<%:Collecting data...%>
-
diff --git a/package/ctcgfw/luci-app-smartinfo/po/zh_Hans/smartinfo.po b/package/ctcgfw/luci-app-smartinfo/po/zh_Hans/smartinfo.po deleted file mode 100644 index 16d12e734d..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/po/zh_Hans/smartinfo.po +++ /dev/null @@ -1,154 +0,0 @@ -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Project-Id-Version: PACKAGE VERSION\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" -"Language: zh_Hans\n" -"MIME-Version: 1.0\n" -"Content-Transfer-Encoding: 8bit\n" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm:65 -msgid "Attrbute" -msgstr "属性名称" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:45 -msgid "Check Interval" -msgstr "检查间隔" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm:75 -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm:77 -msgid "Collecting data..." -msgstr "正在收集数据" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:55 -msgid "Days" -msgstr "天" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm:74 -msgid "Detail" -msgstr "详细" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm:70 -msgid "Device" -msgstr "设备" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:74 -msgid "Devices to monitor" -msgstr "监控这些设备" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:30 -msgid "Enabled" -msgstr "启用" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm:66 -msgid "Flag" -msgstr "标记" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:27 -msgid "Global" -msgstr "全局" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:54 -msgid "Hours" -msgstr "小时" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm:64 -msgid "ID" -msgstr "ID" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:58 -msgid "Log to file" -msgstr "记录到文件" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:53 -msgid "Minutes" -msgstr "分" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm:71 -msgid "Model" -msgstr "型号" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm:49 -msgid "No Attrbute to display." -msgstr "没有可显示的属性" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm:51 -msgid "No storage device to monitor." -msgstr "" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm:72 -msgid "Raw" -msgstr "原始值" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm:61 -msgid "S.M.A.R.T Attrbutes" -msgstr "S.M.A.R.T 属性" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/controller/smartinfo.lua:25 -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:19 -msgid "S.M.A.R.T Info" -msgstr "磁盘监控" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:21 -msgid "S.M.A.R.T Report Settings" -msgstr "S.M.A.R.T 报告设置" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm:67 -msgid "S.M.A.R.T Status" -msgstr "S.M.A.R.T 状况" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm:36 -msgid "Show" -msgstr "查看" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm:72 -msgid "Size" -msgstr "大小" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_status.htm:73 -msgid "Status" -msgstr "状况" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:19 -msgid "" -"This widget allow you to monitor your storage devices which support S.M.A.R." -"T technology." -msgstr "该工具帮助您通过S.M.A.R.T技术来监控您硬盘的健康状况." - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm:69 -msgid "Thresh" -msgstr "临界值" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:66 -msgid "Touch a warning file when disk fail" -msgstr "故障时生成示警文件" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm:70 -msgid "Type" -msgstr "类型" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:50 -msgid "Unit" -msgstr "单位" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm:71 -msgid "Updated" -msgstr "更新" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm:67 -msgid "Value" -msgstr "值" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:56 -msgid "Weeks" -msgstr "周" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/view/smartinfo/smart_detail.htm:68 -msgid "Worst" -msgstr "最坏" - -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:61 -#: /mnt/A/openwrt-latest/package/ctcgfw/luci-app-smartinfo/luasrc/model/cbi/smartinfo.lua:69 -msgid "at" -msgstr "位于" diff --git a/package/ctcgfw/luci-app-smartinfo/root/etc/config/smartinfo b/package/ctcgfw/luci-app-smartinfo/root/etc/config/smartinfo deleted file mode 100644 index 8205c01fa3..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/root/etc/config/smartinfo +++ /dev/null @@ -1,11 +0,0 @@ - -config smartinfo 'main' - option enabled '1' - list device '/dev/sda' - option log_enabled '1' - option log_path '/tmp/DiskLog' - option time_unit 'day' - option time_step '1' - option touch_enabled '1' - option touch_path '/tmp' - diff --git a/package/ctcgfw/luci-app-smartinfo/root/etc/init.d/smartinfo b/package/ctcgfw/luci-app-smartinfo/root/etc/init.d/smartinfo deleted file mode 100755 index 9f9b30c908..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/root/etc/init.d/smartinfo +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh /etc/rc.common -START=95 - -boot() { - return 0 -} - -start() { - /usr/lib/smartinfo/smart_checker.sh > /dev/null 2>&1 & -} - -stop() { - killall -9 smart_checker.sh -} - diff --git a/package/ctcgfw/luci-app-smartinfo/root/usr/lib/smartinfo/smart_checker.sh b/package/ctcgfw/luci-app-smartinfo/root/usr/lib/smartinfo/smart_checker.sh deleted file mode 100755 index ecbedb6abf..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/root/usr/lib/smartinfo/smart_checker.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/sh -# Copyright (C) 2016 NVACG , 穿越蓝天/animefans_xj -# af_xj@hotmail.com -# -#Licensed under the GNU GPL License, Version 3 (the "license"); -#you may not use this file except in compliance with the License. -#you may obtain a copy of the License at -# -# http://www.gnu.org/licenses/gpl.txt - -. /lib/functions.sh -. /usr/lib/smartinfo/smart_functions.sh - -config_load "smartinfo" - -local enable time time_step time_unit log_enabled log_path touch_enable touch_path - -config_get enabled main enabled -config_get time_step main time_step -config_get time_unit main time_unit -config_get log_enabled main log_enabled -config_get log_path main log_path -config_get touch_enabled main touch_enabled -config_get touch_path main touch_path - -echo "NVACG SMART CHECK SCRIPT" -echo "Paramter ===================" -echo "Enabled: $enabled" -echo "Time Step: $time_step" -echo "Time Unit: $time_unit" -echo "Log: $log_enabled" -echo "Path: $log_path" -echo "Touch: $touch_enabled" -echo "Path: $touch_path" - -if [ $enabled -ne 1 ]; then - exit 0 -fi - - -# 根据选定的时间间隔生成秒数 -case $time_unit in - "minute") - let time=time_step*60 - ;; - "hour") - let time=time_step*3600 - ;; - "day") - let time=time_step*86400 - ;; - "week") - let time=time_step*604800 - ;; - *) - let time=time_step*60 - ;; -esac - -echo "Calculated Time: $time" -echo "" - - -main_process() { - do_smart_check $1 - local RETVAL=$? - local Device=`echo $1 |awk -F/ '{print $NF}` - local Model - # 如果指定的磁盘在线则获取型号 - [ -d /sys/class/block/$Device ] && Model=`cat /sys/class/block/$Device/device/vendor``cat /sys/class/block/$Device/device/model` - # 如果路径不存在则创建目录 - [ $log_enabled ] && ! [ -d $log_path ] && mkdir -p $log_path - [ $touch_enabled ] && ! [ -d $touch_path ] && mkdir -p $touch_path - case $RETVAL in - 0) - # 设备健康 - [ $log_enabled ] && [ -d $log_path ] && echo `date '+%Y-%m-%d %H:%M'`" [$Model]: Passed Disk Check." >> $log_path/smartinfo_$Device.log - [ -f $touch_path/$Device-DiskDamaged ] && rm $touch_path/$Device-DiskDamaged - ;; - 1) - # 设备故障 - logger -p daemon.warn -t smartinfo "Device $1 S.M.A.R.T status Failed!" - [ $log_enabled ] && [ -d $log_path ] && echo `date '+%Y-%m-%d %H:%M'`" [$Model]: Disk Damaged." >> $log_path/smartinfo_$Device.log - [ $touch_enabled ] && [ -d $touch_path ] && touch $touch_path/$Device-DiskDamaged - ;; - 2) - # 设备离线 - logger -p daemon.warn -t smartinfo "Device $1 Offline." - [ $log_enabled ] && [ -d $log_path ] && echo `date '+%Y-%m-%d %H:%M'`" : Disk Offline." >> $log_path/smartinfo_$Device.log - [ -f $touch_path/$Device-DiskDamaged ] && rm $touch_path/$Device-DiskDamaged - ;; - 3) - # 不支持S.M.A.R.T - [ $log_enabled ] && [ -d $log_path ] && echo `date '+%Y-%m-%d %H:%M'`" [$Model]: Unsupport S.M.A.R.T." >> $log_path/smartinfo_$Device.log - [ -f $touch_path/$Device-DiskDamaged ] && rm $touch_path/$Device-DiskDamaged - ;; - *) - ;; - esac -} - - -while [ true ] -do - echo `date '+%Y-%m-%d %H:%M'`" Execute the S.M.A.R.T Check." - # 执行S.M.A.R.T检测 - config_list_foreach main device main_process - - # 循环延迟 - sleep $time -done - - diff --git a/package/ctcgfw/luci-app-smartinfo/root/usr/lib/smartinfo/smart_functions.sh b/package/ctcgfw/luci-app-smartinfo/root/usr/lib/smartinfo/smart_functions.sh deleted file mode 100755 index 6a0c3aa382..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/root/usr/lib/smartinfo/smart_functions.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# Copyright (C) 2016 NVACG , 穿越蓝天/animefans_xj -# af_xj@hotmail.com -# -#Licensed under the GNU GPL License, Version 3 (the "license"); -#you may not use this file except in compliance with the License. -#you may obtain a copy of the License at -# -# http://www.gnu.org/licenses/gpl.txt - -do_smart_check() { - # 看看指定的设备是否在线 - if [ -b $1 ]; then - # 如果在线,看看是否支持S.M.A.R.T。支持,则对其执行SMART检测,判断输出是否包含PASSED - result=`/usr/sbin/smartctl -d sat -H $1` - if [ $? -eq "2" ]; then - # 不支持S.M.A.R.T - return 3 - fi - - result=`echo $result | grep -c PASSED` - if [ $result -ne 0 ]; then - #无故障 - return 0 - else - #故障 - return 1 - fi - else - # 设备离线 - return "2" - fi -} - -do_simple_smart_check() { - # 看看指定的设备是否在线 - if [ -b $1 ]; then - # 如果在线,则对其执行SMART检测,判断输出是否包含PASSED - result=`/usr/sbin/smartctl -d sat -H $1` - if [ $? -eq "2" ]; then - # 不支持S.M.A.R.T - echo "$1:Unsupported" - exit 0 - fi - - result=`echo $result | grep -c PASSED` - if [ $result -ne 0 ]; then - echo "$1:OK" - else - echo "$1:Failed" - fi - else - # 如果不在线则输出设备离线 - echo "$1:Offline" - fi -} diff --git a/package/ctcgfw/luci-app-smartinfo/root/usr/lib/smartinfo/smart_status.sh b/package/ctcgfw/luci-app-smartinfo/root/usr/lib/smartinfo/smart_status.sh deleted file mode 100755 index d5203c90f8..0000000000 --- a/package/ctcgfw/luci-app-smartinfo/root/usr/lib/smartinfo/smart_status.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# Copyright (C) 2016 NVACG , 穿越蓝天/animefans_xj -# af_xj@hotmail.com -# -#Licensed under the GNU GPL License, Version 3 (the "license"); -#you may not use this file except in compliance with the License. -#you may obtain a copy of the License at -# -# http://www.gnu.org/licenses/gpl.txt - -. /lib/functions.sh -. /usr/lib/smartinfo/smart_functions.sh - -config_load "smartinfo" - -# 执行S.M.A.R.T检测 -config_list_foreach main device do_simple_smart_check