<commit_before>--[[
LuCI - Lua Configuration Interface

Copyright 2008 <NAME> <<EMAIL>>
Copyright 2008 <NAME> <<EMAIL>>
Copyright 2010 <NAME> <freifunk at somakoma dot 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
]]--

local fs = require "nixio.fs"
local rc = "/etc/rc.local" 

f = SimpleForm("rc", translate("Startup"), translate([[This is the content of /etc/rc.local. Insert your own commands here
	 (in front of 'exit 0') to execute them at the end of the boot process.]]))

t = f:field(TextValue, "rcs")
t.rmempty = true
t.rows = 20
function t.cfgvalue()
	return fs.readfile(rc) or ""
end

function f.handle(self, state, data)
	if state == FORM_VALID then
		if data.rcs then
			fs.writefile(rc, data.rcs:gsub("\r\n", "\n"))
		end
	end
	return true
end
<commit_msg>applications/luci-initmgr: Changed header<commit_after>--[[
LuCI - Lua Configuration Interface

Copyright 2008 <NAME> <<EMAIL>>
Copyright 2008 <NAME> <<EMAIL>>
Copyright 2010 <NAME> <freifunk at somakoma dot 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
]]--

local fs = require "nixio.fs"
local rc = "/etc/rc.local" 

f = SimpleForm("rc", translate("Local Startup"), translate([[This is the content of /etc/rc.local. Insert your own commands here
	 (in front of 'exit 0') to execute them at the end of the boot process.]]))

t = f:field(TextValue, "rcs")
t.rmempty = true
t.rows = 20
function t.cfgvalue()
	return fs.readfile(rc) or ""
end

function f.handle(self, state, data)
	if state == FORM_VALID then
		if data.rcs then
			fs.writefile(rc, data.rcs:gsub("\r\n", "\n"))
		end
	end
	return true
end

{'fraction_non_alphanumeric': 0.13072916666666667, 'fraction_numerical': 0.019791666666666666, 'mean_word_length': 4.0552631578947365, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6715956', 'n_tokens_mistral': 693, 'n_tokens_neox': 641, 'n_words': 243}