luci.i18n.loadc("initmgr")
entry(
- {"admin", "system", "init"}, form("init/init"),
- luci.i18n.translate("initmgr", "Init Scripts")
+ {"admin", "services", "init"}, form("init/init"),
+ luci.i18n.translate("initmgr", "Init Scripts"), 0
).i18n = "initmgr"
end
m = SimpleForm("initmgr", translate("initmgr"), translate("initmgr_desc"))
m.reset = false
+m.submit = false
+
s = m:section(Table, inits)
i = s:option(DummyValue, "index", translate("initmgr_index"))
n = s:option(DummyValue, "name", translate("initmgr_name"))
-e = s:option(Flag, "enabled", translate("initmgr_enabled"))
-e.rmempty = false
-e.cfgvalue = function(self, section)
- return inits[section].enabled and "1" or "0"
+e = s:option(Button, "endisable", translate("initmgr_enabled"))
+
+e.render = function(self, section, scope)
+ if inits[section].enabled then
+ self.title = translate("initmgr_enable", "Enabled")
+ self.inputstyle = "save"
+ else
+ self.title = translate("initmgr_disable", "Disabled")
+ self.inputstyle = "reset"
+ end
+
+ Button.render(self, section, scope)
end
-e.write = function(self, section, value)
- if value == "1" and not inits[section].enabled then
- inits[section].enabled = true
- return luci.sys.init.enable(inits[section].name)
- elseif value == "0" and inits[section].enabled then
+e.write = function(self, section)
+ if inits[section].enabled then
inits[section].enabled = false
return luci.sys.init.disable(inits[section].name)
+ else
+ inits[section].enabled = true
+ return luci.sys.init.enable(inits[section].name)
end
- return true
end
+
+start = s:option(Button, "start", translate("initmgr_start", "Start"))
+start.inputstyle = "apply"
+start.write = function(self, section)
+ luci.sys.call("/etc/init.d/%s %s" %{ inits[section].name, self.option })
+end
+
+restart = s:option(Button, "restart", translate("initmgr_restart", "Restart"))
+restart.inputstyle = "reload"
+restart.write = start.write
+
+stop = s:option(Button, "stop", translate("initmgr_stop", "Stop"))
+stop.inputstyle = "remove"
+stop.write = start.write
+
+
return m
+
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5
msgid "initmgr_enabled"
msgstr "Activa/Desactiva"
+
+#. Start
+msgid "initmgr_start"
+msgstr ""
+
+#. Stop
+msgid "initmgr_stop"
+msgstr ""
+
+#. Reload
+msgid "initmgr_reload"
+msgstr ""
msgid "initmgr_desc"
msgstr ""
"Hier können installierte Startscripte aktiviert oder deaktiviert werden. "
-"Änderungen werden erst mit einem Geräteneustart angewendet.<br "
-"/><strong>Warnung: Wenn essentialle Startscripte wie "network" "
+"Änderungen werden erst mit einem Geräteneustart angewendet.<br /"
+"><strong>Warnung: Wenn essentialle Startscripte wie "network" "
"deaktiviert werden könnte das Gerät unerreichbar werden!</strong>"
#. Start priority
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5
msgid "initmgr_enabled"
msgstr "Aktivieren/Deaktivieren"
+
+#. Start
+msgid "initmgr_start"
+msgstr ""
+
+#. Stop
+msgid "initmgr_stop"
+msgstr ""
+
+#. Reload
+msgid "initmgr_reload"
+msgstr ""
msgid "initmgr_desc"
msgstr ""
"Μπορείτε να ενεργοποιήσετε ή να απενεργοποιήσετε σενάρια εκκίνησης εδώ. Οι "
-"αλλαγές θα εφαρμοστούν αφού επανεκκινήσετε τη συσκευή.<br "
-"/><strong>Προειδοποίηση: Αν απενεργοποιήσετε απαραίτητα σενάρια εκκίνησης "
-"όπως το "network", η συσκευή σας μπορεί να γίνει "
-"μη-προσβάσιμη!</strong>"
+"αλλαγές θα εφαρμοστούν αφού επανεκκινήσετε τη συσκευή.<br /"
+"><strong>Προειδοποίηση: Αν απενεργοποιήσετε απαραίτητα σενάρια εκκίνησης "
+"όπως το "network", η συσκευή σας μπορεί να γίνει μη-προσβάσιμη!</"
+"strong>"
#. Start priority
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:3
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5
msgid "initmgr_enabled"
msgstr "Ενεργοποίηση/Απενεργοποίηση"
+
+#. Start
+msgid "initmgr_start"
+msgstr ""
+
+#. Stop
+msgid "initmgr_stop"
+msgstr ""
+
+#. Reload
+msgid "initmgr_reload"
+msgstr ""
msgstr ""
"You can enable or disable installed init scripts here. Changes will applied "
"after a device reboot.<br /><strong>Warning: If you disable essential init "
-"scripts like "network", your device might become "
-"inaccesable!</strong>"
+"scripts like "network", your device might become inaccesable!</"
+"strong>"
#. Start priority
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:3
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5
msgid "initmgr_enabled"
msgstr "Enable/Disable"
+
+#. Start
+msgid "initmgr_start"
+msgstr ""
+
+#. Stop
+msgid "initmgr_stop"
+msgstr ""
+
+#. Reload
+msgid "initmgr_reload"
+msgstr ""
msgid "initmgr_desc"
msgstr ""
"Puede activar o desactivar los scripts de inicio (init scripts) desde aquí. "
-"Los cambios serána plicados luego de que reinicie el equipo.<br "
-"/><strong>ADVERTENCIA: Si desactiva scripts de inicio esenciales como "
-"&quot;network&quot;, su equipo puede no iniciar o volverne "
-"inaccesible!.</strong>"
+"Los cambios serána plicados luego de que reinicie el equipo.<br /"
+"><strong>ADVERTENCIA: Si desactiva scripts de inicio esenciales como &"
+"quot;network&quot;, su equipo puede no iniciar o volverne inaccesible!.</"
+"strong>"
#. Start priority
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:3
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5
msgid "initmgr_enabled"
msgstr "Activar/Desactivar"
+
+#. Start
+msgid "initmgr_start"
+msgstr ""
+
+#. Stop
+msgid "initmgr_stop"
+msgstr ""
+
+#. Reload
+msgid "initmgr_reload"
+msgstr ""
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5
msgid "initmgr_enabled"
msgstr ""
+
+#. Start
+msgid "initmgr_start"
+msgstr ""
+
+#. Stop
+msgid "initmgr_stop"
+msgstr ""
+
+#. Reload
+msgid "initmgr_reload"
+msgstr ""
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5
msgid "initmgr_enabled"
msgstr ""
+
+#. Start
+msgid "initmgr_start"
+msgstr ""
+
+#. Stop
+msgid "initmgr_stop"
+msgstr ""
+
+#. Reload
+msgid "initmgr_reload"
+msgstr ""
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5
msgid "initmgr_enabled"
msgstr ""
+
+#. Start
+msgid "initmgr_start"
+msgstr ""
+
+#. Stop
+msgid "initmgr_stop"
+msgstr ""
+
+#. Reload
+msgid "initmgr_reload"
+msgstr ""
msgid "initmgr_desc"
msgstr ""
"Você pode ativar ou desativar os scripts de inicialização instalados aqui. "
-"As mudanças serão aplicadas após a reinicialização do equipamento.<br "
-"/><strong>Aviso: Se você desativar algum script de inicialização essencial "
+"As mudanças serão aplicadas após a reinicialização do equipamento.<br /"
+"><strong>Aviso: Se você desativar algum script de inicialização essencial "
"como por exemplo "rede/network", o dispositivo poderá tornar-se "
"inacessível!</strong>"
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5
msgid "initmgr_enabled"
msgstr "Ativar/Desativar"
+
+#. Start
+msgid "initmgr_start"
+msgstr ""
+
+#. Stop
+msgid "initmgr_stop"
+msgstr ""
+
+#. Reload
+msgid "initmgr_reload"
+msgstr ""
msgid "initmgr_desc"
msgstr ""
"Você pode ativar ou desativar os scripts de inicialização instalados aqui. "
-"As mudanças serão aplicadas após a reinicialização do equipamento.<br "
-"/><strong>Aviso: Se você desativar algum script de inicialização essencial "
+"As mudanças serão aplicadas após a reinicialização do equipamento.<br /"
+"><strong>Aviso: Se você desativar algum script de inicialização essencial "
"como por exemplo "rede/network", o dispositivo poderá tornar-se "
"inacessível!</strong>"
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5
msgid "initmgr_enabled"
msgstr "Ativar/Desativar"
+
+#. Start
+msgid "initmgr_start"
+msgstr ""
+
+#. Stop
+msgid "initmgr_stop"
+msgstr ""
+
+#. Reload
+msgid "initmgr_reload"
+msgstr ""
#: applications/luci-initmgr/luasrc/i18n/initmgr.en.lua:5
msgid "initmgr_enabled"
msgstr ""
+
+#. Start
+msgid "initmgr_start"
+msgstr ""
+
+#. Stop
+msgid "initmgr_stop"
+msgstr ""
+
+#. Reload
+msgid "initmgr_reload"
+msgstr ""