* luci/applications: add hd-idle application, thanks Yanira
This commit is contained in:
parent
b5de7f8138
commit
3f372dd416
10 changed files with 131 additions and 0 deletions
2
applications/luci-hd_idle/Makefile
Normal file
2
applications/luci-hd_idle/Makefile
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
include ../../build/config.mk
|
||||||
|
include ../../build/module.mk
|
4
applications/luci-hd_idle/ipkg/postinst
Normal file
4
applications/luci-hd_idle/ipkg/postinst
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
[ -n "${IPKG_INSTROOT}" ] || {
|
||||||
|
( . /etc/uci-defaults/luci-hd_idle ) && rm -f /etc/uci-defaults/luci-hd_idle
|
||||||
|
}
|
28
applications/luci-hd_idle/luasrc/controller/hd_idle.lua
Normal file
28
applications/luci-hd_idle/luasrc/controller/hd_idle.lua
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
--[[
|
||||||
|
|
||||||
|
LuCI hd-idle
|
||||||
|
(c) 2008 Yanira <forum-2008@email.de>
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
]]--
|
||||||
|
|
||||||
|
module("luci.controller.hd_idle", package.seeall)
|
||||||
|
|
||||||
|
function index()
|
||||||
|
require("luci.i18n")
|
||||||
|
luci.i18n.loadc("hd_idle")
|
||||||
|
if not luci.fs.isfile("/etc/config/hd-idle") then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local page = entry({"admin", "services", "hd_idle"}, cbi("hd_idle"), luci.i18n.translate("hd_idle", "hd-idle"), 60)
|
||||||
|
page.i18n = "hd_idle"
|
||||||
|
page.dependent = true
|
||||||
|
end
|
7
applications/luci-hd_idle/luasrc/i18n/hd_idle.de.lua
Normal file
7
applications/luci-hd_idle/luasrc/i18n/hd_idle.de.lua
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
disk = 'Festplatte'
|
||||||
|
enable_debug = 'Debug-Ausgaben aktivieren'
|
||||||
|
hd_idle = 'hd-idle'
|
||||||
|
hd_idle_desc = 'hd-idle ist ein Hilfsprogramm um externe Festplatten nach einer festgelegten Leerlaufzeit herunter zu fahren.'
|
||||||
|
idle_time_interval = 'Leerlaufzeit'
|
||||||
|
idle_time_unit = 'Leerlaufzeiteinheit'
|
||||||
|
settings = 'Einstellungen'
|
13
applications/luci-hd_idle/luasrc/i18n/hd_idle.de.xml
Normal file
13
applications/luci-hd_idle/luasrc/i18n/hd_idle.de.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<i18n:msgs xmlns:i18n="http://luci.freifunk-halle.net/2008/i18n#" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
|
||||||
|
<i18n:msg xml:id="disk">Festplatte</i18n:msg>
|
||||||
|
<i18n:msg xml:id="enable_debug">Debug-Ausgaben aktivieren</i18n:msg>
|
||||||
|
<i18n:msg xml:id="hd_idle">hd-idle</i18n:msg>
|
||||||
|
<i18n:msg xml:id="hd_idle_desc">hd-idle ist ein Hilfsprogramm um externe Festplatten nach einer festgelegten Leerlaufzeit herunter zu fahren.</i18n:msg>
|
||||||
|
<i18n:msg xml:id="idle_time_interval">Leerlaufzeit</i18n:msg>
|
||||||
|
<i18n:msg xml:id="idle_time_unit">Leerlaufzeiteinheit</i18n:msg>
|
||||||
|
<i18n:msg xml:id="settings">Einstellungen</i18n:msg>
|
||||||
|
|
||||||
|
</i18n:msgs>
|
7
applications/luci-hd_idle/luasrc/i18n/hd_idle.en.lua
Normal file
7
applications/luci-hd_idle/luasrc/i18n/hd_idle.en.lua
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
disk = 'Disk'
|
||||||
|
enable_debug = 'Enable debug'
|
||||||
|
hd_idle = 'hd-idle'
|
||||||
|
hd_idle_desc = 'hd-idle is a utility program for spinning-down external disks after a period of idle time.'
|
||||||
|
idle_time_interval = 'Idle-Time'
|
||||||
|
idle_time_unit = 'Idle-Time unit'
|
||||||
|
settings = 'Settings'
|
13
applications/luci-hd_idle/luasrc/i18n/hd_idle.en.xml
Normal file
13
applications/luci-hd_idle/luasrc/i18n/hd_idle.en.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<i18n:msgs xmlns:i18n="http://luci.freifunk-halle.net/2008/i18n#" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
|
||||||
|
<i18n:msg xml:id="disk">Disk</i18n:msg>
|
||||||
|
<i18n:msg xml:id="enable_debug">Enable debug</i18n:msg>
|
||||||
|
<i18n:msg xml:id="hd_idle">hd-idle</i18n:msg>
|
||||||
|
<i18n:msg xml:id="hd_idle_desc">hd-idle is a utility program for spinning-down external disks after a period of idle time.</i18n:msg>
|
||||||
|
<i18n:msg xml:id="idle_time_interval">Idle-Time</i18n:msg>
|
||||||
|
<i18n:msg xml:id="idle_time_unit">Idle-Time unit</i18n:msg>
|
||||||
|
<i18n:msg xml:id="settings">Settings</i18n:msg>
|
||||||
|
|
||||||
|
</i18n:msgs>
|
36
applications/luci-hd_idle/luasrc/model/cbi/hd_idle.lua
Normal file
36
applications/luci-hd_idle/luasrc/model/cbi/hd_idle.lua
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
--[[
|
||||||
|
|
||||||
|
LuCI hd-idle
|
||||||
|
(c) 2008 Yanira <forum-2008@email.de>
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
]]--
|
||||||
|
|
||||||
|
m = Map("hd-idle", translate("hd_idle"), translate("hd_idle_desc"))
|
||||||
|
|
||||||
|
s = m:section(TypedSection, "hd-idle", translate("settings"))
|
||||||
|
s.addremove = true
|
||||||
|
s.anonymous = true
|
||||||
|
|
||||||
|
s:option(Flag, "enabled", translate("enabled", "Enable"))
|
||||||
|
|
||||||
|
s:option(Value, "disk", translate("disk")).rmempty = true
|
||||||
|
|
||||||
|
s:option(Value, "idle_time_interval", translate("idle_time_interval")).default = 10
|
||||||
|
s.rmempty = true
|
||||||
|
unit = s:option(ListValue, "idle_time_unit", translate("idle_time_unit"))
|
||||||
|
unit.default = "minutes"
|
||||||
|
unit:value("minutes", "min")
|
||||||
|
unit:value("hours", "h")
|
||||||
|
unit.rmempty = true
|
||||||
|
|
||||||
|
s:option(Flag, "enable_debug", translate("enable_debug"))
|
||||||
|
|
||||||
|
return m
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
uci batch <<-EOF
|
||||||
|
add ucitrack hd-idle
|
||||||
|
set ucitrack.@hd-idle[-1].init=hd-idle
|
||||||
|
commit ucitrack
|
||||||
|
EOF
|
|
@ -484,6 +484,16 @@ define Package/luci-app-ushare/install
|
||||||
$(call Package/luci/install/template,$(1),applications/luci-ushare)
|
$(call Package/luci/install/template,$(1),applications/luci-ushare)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/luci-app-hd_idle
|
||||||
|
$(call Package/luci/webtemplate)
|
||||||
|
DEPENDS+=+luci-admin-full +hd-idle
|
||||||
|
TITLE:=hd-idle
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/luci-app-hd_idle/install
|
||||||
|
$(call Package/luci/install/template,$(1),applications/luci-hd_idle)
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
### Server Gateway Interfaces ###
|
### Server Gateway Interfaces ###
|
||||||
|
|
||||||
|
@ -713,6 +723,9 @@ endif
|
||||||
ifneq ($(CONFIG_PACKAGE_luci-app-ushare),)
|
ifneq ($(CONFIG_PACKAGE_luci-app-ushare),)
|
||||||
PKG_SELECTED_MODULES+=applications/luci-ushare
|
PKG_SELECTED_MODULES+=applications/luci-ushare
|
||||||
endif
|
endif
|
||||||
|
ifneq ($(CONFIG_PACKAGE_luci-app-hd_idle),)
|
||||||
|
PKG_SELECTED_MODULES+=applications/luci-hd_idle
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
ifneq ($(CONFIG_PACKAGE_luci-sgi-cgi),)
|
ifneq ($(CONFIG_PACKAGE_luci-sgi-cgi),)
|
||||||
|
@ -801,6 +814,7 @@ $(eval $(call BuildPackage,luci-app-samba))
|
||||||
$(eval $(call BuildPackage,luci-app-uvc_streamer))
|
$(eval $(call BuildPackage,luci-app-uvc_streamer))
|
||||||
$(eval $(call BuildPackage,luci-app-p910nd))
|
$(eval $(call BuildPackage,luci-app-p910nd))
|
||||||
$(eval $(call BuildPackage,luci-app-ushare))
|
$(eval $(call BuildPackage,luci-app-ushare))
|
||||||
|
$(eval $(call BuildPackage,luci-app-hd_idle))
|
||||||
|
|
||||||
$(eval $(call BuildPackage,luci-sgi-cgi))
|
$(eval $(call BuildPackage,luci-sgi-cgi))
|
||||||
$(eval $(call BuildPackage,luci-sgi-luci))
|
$(eval $(call BuildPackage,luci-sgi-luci))
|
||||||
|
|
Loading…
Reference in a new issue