return buffer
end
---- Execute command and invoke given callback for each readed line
+--- Execute command and invoke given callback for each read line
-- @param command String containing the command to execute
-- @param callback Function to call back for each line
-- @return Always true
return true
end
---- Execute command and return an iterator that returns one line per invokation
+--- Execute command and return an iterator that returns one line per invocation
-- @param command String containing the command to execute
-- @return Iterator function
function io.execi(command)
--- LuCI Asterisk - core status
core = luci.util.class()
---- Retrive version string.
+--- Retrieve version string.
-- @return String containing the reported asterisk version
function core.version(self)
local version = io.exec("core show version")
return peers
end
---- Get informations of given SIP peer
+--- Get information of given SIP peer
-- @param peer String containing the name of the SIP peer
function sip.peer(peer)
local info = { }
--- Convert given list to a collection of hyperlinks
-- @param list Table of tokens
-- @param url String pattern or callback function to construct urls (optional)
--- @param sep String containing the seperator (optional, default is ", ")
+-- @param sep String containing the separator (optional, default is ", ")
-- @return String containing the html fragment
function tools.hyperlinks(list, url, sep)
local html
<div class="cbi-section-create cbi-tblsection-create" style="padding: 3px">
<h3>Create a new dialzone</h3>
The name is required and must be unique. It may only contain the characters A-Z, a-z, 0-9 and _ .<br />
- You can specifiy multiple number matches by separating them with spaces.<br />
+ You can specify multiple number matches by separating them with spaces.<br />
<%- if create_error then %>
<br /><span style="color:red">Invalid name given!</span><br />
-- will use dynamic_dns_lucihelper to check if
-- local IP can be read
local function _verify_ip_source()
- -- section is globally defined here be calling agrument (see above)
+ -- section is globally defined here be calling argument (see above)
local _arg
local _ipv6 = usev6:formvalue(section)
-- function to verify if option is valid
local function _option_validate(self, value, optional)
- -- section is globally defined here be calling agrument (see above)
+ -- section is globally defined here be calling argument (see above)
local fusev6 = usev6:formvalue(section) or "0"
local fsvc4 = svc4:formvalue(section) or "-"
local fsvc6 = svc6:formvalue(section) or "-"
if (#urlsh == 0) then return "" end
used = _option_used(self.option, urlsh)
- -- on error or not used return empty sting
+ -- on error or not used return empty string
if used < 1 then return "" end
-- needed but no data then return error
if not value or (#value == 0) then
}
}
else {
- // beginn somewhere
+ // begin somewhere
n.x = Math.random()*400;
n.y = Math.random()*400;
}
elseif v < 1 or v > 4096 then
return nil, err_tab_access(self.title_base, translate("Value not between 1 and 4096") )
elseif v == self.default then
- return "" -- dont need to save default
+ return "" -- don't need to save default
end
return value
end
elseif v < 1 then
return nil, err_tab_misc(self.title_base, translate("Value not greater 0 or empty") )
elseif v == self.default then
- return "" -- dont need to save default
+ return "" -- don't need to save default
end
return value
end
elseif v < 1 then
return nil, err_tab_misc(self.title_base, translate("Value not greater 0 or empty") )
elseif v == self.default then
- return "" -- dont need to save default
+ return "" -- don't need to save default
end
return value
end
-- * wl0 gets an ipv6 address, in this case the fdca:ffee:babe::1:1/64
-- * we do a ::ffff:ffff:0/96 route into siit0, so everything from 6mesh goes into translation.
-- * an HNA6 of ::ffff:ffff:0:0/96 announces the mapped 0.0.0.0/0 ipv4 space.
- -- * MTU on WAN, LAN down to 1400, ipv6 headers are slighly larger.
+ -- * MTU on WAN, LAN down to 1400, ipv6 headers are slightly larger.
if value == "gateway" then
is limited and because of this we ask you not to do any of the following:%></p>
<ul>
<li><%:use filesharing applications on this network%></li>
- <li><%:waste bandwidth with unneccesary downloads or streams%></li>
+ <li><%:waste bandwidth with unnecessary downloads or streams%></li>
<li><%:perform any kind of illegal activities%></li>
</ul>
<br />
[ -s $IPT_REPLAY ] && . $IPT_REPLAY
echo -n > $IPT_REPLAY
- ### Add interface independant prerouting rules
+ ### Add interface independent prerouting rules
$IPT -t nat -A luci_splash_prerouting -j luci_splash_leases
$IPT -t nat -A luci_splash_leases -p udp --dport 53 -j REDIRECT --to-ports 53
$IPT -t nat -A luci_splash_leases -p tcp --dport 80 -j REDIRECT --to-ports 8082
- ### Add interface independant forwarding rules
+ ### Add interface independent forwarding rules
$IPT -t filter -A luci_splash_forwarding -j luci_splash_filter
$IPT -t filter -A luci_splash_filter -p tcp -j REJECT --reject-with tcp-reset
$IPT -t filter -A luci_splash_filter -j REJECT --reject-with icmp-net-prohibited
require("luci.util")
require("luci.statistics.datatree")
- -- override entry(): check for existance <plugin>.so where <plugin> is derived from the called path
+ -- override entry(): check for existence <plugin>.so where <plugin> is derived from the called path
function _entry( path, ... )
local file = path[5] or path[4]
if nixio.fs.access( "/usr/lib/collectd/" .. file .. ".so" ) then
-- diagram data description
data = {
- -- defined sources for data types, if ommitted assume a single DS named "value" (optional)
+ -- defined sources for data types, if omitted assume a single DS named "value" (optional)
sources = {
if_octets = { "tx", "rx" }
},
-- diagram data description
data = {
- -- defined sources for data types, if ommitted assume a single DS named "value" (optional)
+ -- defined sources for data types, if omitted assume a single DS named "value" (optional)
sources = {
if_octets = { "tx", "rx" }
},
function ztype.cfgvalue(self, s)
- -- Format a meaninful tile for the Zone Type column
+ -- Format a meaningful tile for the Zone Type column
local itxt = self.map:get(s, "zone_type")
local itls = self.map:get(s, "tls_upstream")
function zones.cfgvalue(self, s)
- -- Format a meaninful sentence for the Zones viewed column
+ -- Format a meaningful sentence for the Zones viewed column
local xtxt, otxt
local itxt = self.map:get(s, "zone_name")
local itype = self.map:get(s, "zone_type")
function servers.cfgvalue(self, s)
- -- Format a meaninful sentence for the Servers (and URL) column
+ -- Format a meaningful sentence for the Servers (and URL) column
local xtxt, otxt, rtxt, found
local itxt = self.map:get(s, "server")
local iurl = self.map:get(s, "url_dir")
## Use cases
-You can create user-defined events when to enable or disable WiFi.
+You can create user-defined events when to enable or disable WiFi.
There are various use cases why you would like to do so:
1. Reduce power consumption and therefore reduce CO2 emissions.
Regarding 1: Please note, that you need to unload the wireless driver modules in order to get the most effect of saving power.
In my test scenario only disabling WiFi saves about ~0.4 Watt, unloading the modules removes another ~0.4 Watt.
-Regarding 2: Think of a wireless accesspoint e.g. in your bedrom, kids room where you want to remove the ammount of radiation emitted.
+Regarding 2: Think of a wireless accesspoint e.g. in your bedrom, kids room where you want to remove the amount of radiation emitted.
-Regarding 3: E.g. in a company, why would wireless need to be enabled weekends if no one is there working?
+Regarding 3: E.g. in a company, why would wireless need to be enabled weekends if no one is there working?
Or think of an accesspoint in your kids room when you want the youngsters to sleep after 10 pm instead of facebooking...
## Configuration
-You can create an arbitrary number of schedule events. Please note that there is on sanity check done wheather the start / stop times overlap or make sense.
+You can create an arbitrary number of schedule events. Please note that there is on sanity check done whether the start / stop times overlap or make sense.
If start and stop time are equal, this leads to disabling the WiFi at the given time.
Logging if enabled is done to the file `/var/log/wifi_schedule.log` and can be reviewed through the "View Logfile" tab.
`wifi_schedule.sh cron`
All commands:
-
+
```
wifi_schedule.sh cron|start|stop|forcestop|recheck|getmodules|savemodules|help
package="${controller##*/controller/}"; package="${package%.lua}"; package="luci.controller.${package//\//.}"
if ! grep -sqE '\bmodule[[:space:]]*\(?[[:space:]]*("|\047|\[=*\[)'"$package" "$controller"; then
- echo "'$controller' does not containt the expected\n\t'module(\"$package\", ...)' line.\n"
+ echo "'$controller' does not contain the expected\n\t'module(\"$package\", ...)' line.\n"
fi
grep -sqE '\b(Form|SimpleForm)[[:space:]]*\(' "$model" && ! grep -sqE '\bMap[[:space:]]*\(' "$model" && is_form=1 || is_form=0
use warnings;
use Text::Balanced qw(extract_bracketed extract_delimited extract_tagged);
-@ARGV >= 1 || die "Usage: $0 <source direcory>\n";
+@ARGV >= 1 || die "Usage: $0 <source directory>\n";
my %stringtable;
-------------------------------------------------------------------------------
-- LuaDoc configuration file. This file contains the default options for
--- luadoc operation. These options can be overriden by the command line tool
+-- luadoc operation. These options can be overridden by the command line tool
-- @see luadoc.print_help
-- @release $Id: config.lua,v 1.6 2007/04/18 14:28:39 tomas Exp $
-------------------------------------------------------------------------------
b="${b//_/ }"
string_contains "$a" "_LENGTH" && continue
string_contains "$a" "_ITEM" && {
- # special threatment for lists. use add_list and remove the
+ # special treatment for lists. use add_list and remove the
# item index (_ITEMx).
uci add_list $2.${a//_ITEM[0-9]*/}="$b"
} || {
Adds an entry to the selection list
#### property .widget = "select"
-**"select"** shows a selction list, **"radio"** shows a list of radio buttons inside form
+**"select"** shows a selection list, **"radio"** shows a list of radio buttons inside form
#### property .default = nil
The default value
Adds an entry to the list
#### property .widget = "checkbox"
-**"select"** shows a selction list, **"checkbox"** shows a list of checkboxes inside form
+**"select"** shows a selection list, **"checkbox"** shows a list of checkboxes inside form
#### property .delimiter = " "
The string which will be used to delimit the values inside stored option
LuCI has a simple regex based template processor which parses HTML-files to Lua functions and allows to store precompiled template files.
The simplest form of a template is just an ordinary HTML-file. It will be printed out to the user as is.
-In LuCI every template is an object with an own scope. It can therefore be instanciated and each instance can has a different scope. As every template processor. LuCI supports several special markups. Those are enclosed in `<% %>`-Tags.
+In LuCI every template is an object with an own scope. It can therefore be instantiated and each instance can has a different scope. As every template processor. LuCI supports several special markups. Those are enclosed in `<% %>`-Tags.
By adding `-` (dash) right after the opening `<%` every whitespace before the markup will be stripped. Adding a `-` right before the closing `%>` will equivalently strip every whitespace behind the markup.
module "luci.http.mime"
---[[
-MIME mapping table containg extension - mimetype relations.
+MIME mapping table containing extension - mimetype relations.
@class table
]]
@sort 9
@name routes
@param filter <p>Table containing one or more of the possible filter
-critera described below (optional)</p><table>
+criteria described below (optional)</p><table>
<tr><th>Field</th><th>Description</th></tr>
<tr><td>`family`</td><td>
Number describing the address family to return - `4` selects
@sort 10
@name neighbors
@param filter <p>Table containing one or more of the possible filter
-critera described below (optional)</p><table>
+criteria described below (optional)</p><table>
<tr><th>Field</th><th>Description</th></tr>
<tr><td>`family`</td><td>
Number describing the address family to return - `4` selects
@class function
@sort 10
@name cidr.lower
-@param addr A `luci.ip.cidr` instance or a string convertable by
+@param addr A `luci.ip.cidr` instance or a string convertible by
`luci.ip.new()` to compare against.
@return `true` if this CIDR is lower than the given address,
else `false`.
@class function
@sort 11
@name cidr.higher
-@param addr A `luci.ip.cidr` instance or a string convertable by
+@param addr A `luci.ip.cidr` instance or a string convertible by
`luci.ip.new()` to compare against.
@return `true` if this CIDR is higher than the given address,
else `false`.
@class function
@sort 12
@name cidr.equal
-@param addr A `luci.ip.cidr` instance or a string convertable by
+@param addr A `luci.ip.cidr` instance or a string convertible by
`luci.ip.new()` to compare against.
@return `true` if this CIDR is equal to the given address,
else `false`.
@class function
@sort 21
@name cidr.contains
-@param addr A `luci.ip.cidr` instance or a string convertable by
+@param addr A `luci.ip.cidr` instance or a string convertible by
`luci.ip.new()` to test.
@return `true` if this instance fully contains the given address else
`false`.
@sort 22
@name cidr.add
@param amount A numeric value between 0 and 0xFFFFFFFF, a
- `luci.ip.cidr` instance or a string convertable by
+ `luci.ip.cidr` instance or a string convertible by
`luci.ip.new()`.
@param inplace If `true`, modify this instance instead of returning
a new derived CIDR instance.
@return <ul>
- <li>When adding inplace: Return `true` if the addition succeded
+ <li>When adding inplace: Return `true` if the addition succeeded
or `false` when the addition overflowed.</li>
<li>When deriving new CIDR: Return new instance representing the value of
this instance plus the added amount or the highest possible address if
@sort 23
@name cidr.sub
@param amount A numeric value between 0 and 0xFFFFFFFF, a
- `luci.ip.cidr` instance or a string convertable by
+ `luci.ip.cidr` instance or a string convertible by
`luci.ip.new()`.
@param inplace If `true`, modify this instance instead of returning
a new derived CIDR instance.
-- <li>Added support for x509 certificates in DER format.</li>
-- <li>Added support for splice() in UnifiedIO.copyz().</li>
-- <li>Added interface to inject chunks into UnifiedIO.linesource() buffer.</li>
--- <li>Changed TLS behaviour to explicitely separate servers and clients.</li>
+-- <li>Changed TLS behaviour to explicitly separate servers and clients.</li>
-- <li>Fixed usage of signed datatype breaking Base64 decoding.</li>
-- <li>Fixed namespace clashes for nixio.fs.</li>
-- <li>Fixed splice() support for some exotic C libraries.</li>
-- table <strong>nixio.const_sock</strong> for socket error codes. This might
-- be important if you are dealing with Windows applications, on POSIX however
-- const_sock is just an alias for const.</li>
--- <li>With some exceptions - which are explicitely stated in the function
+-- <li>With some exceptions - which are explicitly stated in the function
-- documentation - all blocking functions are signal-protected and will not fail
-- with EINTR.</li>
-- <li>On POSIX the SIGPIPE signal will be set to ignore upon initialization.
-- <li>aliases = Table of alias names</li>
-- </ul>
---- Get all or a specifc proto entry.
+--- Get all or a specific proto entry.
-- @class function
-- @name nixio.getproto
-- @param proto protocol number or name to lookup (optional)
}
/*
- * Helper for mpi substraction
+ * Helper for mpi subtraction
*/
static void mpi_sub_hlp( int n, t_int *s, t_int *d )
{
}
/*
- * Unsigned substraction: X = |A| - |B| (HAC 14.9)
+ * Unsigned subtraction: X = |A| - |B| (HAC 14.9)
*/
int mpi_sub_abs( mpi *X, mpi *A, mpi *B )
{
}
/*
- * Signed substraction: X = A - B
+ * Signed subtraction: X = A - B
*/
int mpi_sub_mpi( mpi *X, mpi *A, mpi *B )
{
}
/*
- * Signed substraction: X = A - b
+ * Signed subtraction: X = A - b
*/
int mpi_sub_int( mpi *X, mpi *A, int b )
{
* MA 02110-1301 USA
*/
/*
- * The ITU-T X.509 standard defines a certificat format for PKI.
+ * The ITU-T X.509 standard defines a certificate format for PKI.
*
* http://www.ietf.org/rfc/rfc2459.txt
* http://www.ietf.org/rfc/rfc3279.txt
}
/*
- * write the asn.1 lenght form into p
+ * write the asn.1 length form into p
*/
static int asn1_add_len(unsigned int size, x509_node *node)
{
R_len = len;
}
- /* set tag poiner to begin */
+ /* set tag pointer to begin */
tag_sp = tag;
/* is at end? */
}
/*
- * Copy raw data from orginal ca to node
+ * Copy raw data from original ca to node
*/
static int x509write_copy_from_raw(x509_node *node, x509_buf *raw)
{
int mpi_add_abs( mpi *X, mpi *A, mpi *B );
/**
- * \brief Unsigned substraction: X = |A| - |B|
+ * \brief Unsigned subtraction: X = |A| - |B|
*
* \return 0 if successful,
* POLARSSL_ERR_MPI_NEGATIVE_VALUE if B is greater than A
int mpi_add_mpi( mpi *X, mpi *A, mpi *B );
/**
- * \brief Signed substraction: X = A - B
+ * \brief Signed subtraction: X = A - B
*
* \return 0 if successful,
* 1 if memory allocation failed
int mpi_add_int( mpi *X, mpi *A, int b );
/**
- * \brief Signed substraction: X = A - b
+ * \brief Signed subtraction: X = A - b
*
* \return 0 if successful,
* 1 if memory allocation failed
* the string parse.
*
* \param chain points to the raw certificate data
- * \param names a string that can hold (separete with ";"):
+ * \param names a string that can hold (separate with ";"):
* CN=CommonName
* -- O=Organization
* -- OU=OrgUnit
* \brief Add x509 issuer field
*
* \param chain points to the raw certificate data
-* \param issuer a string holding (separete with ";"):
+* \param issuer a string holding (separate with ";"):
* CN=CommonName
* -- O=Organization
* -- OU=OrgUnit
* \brief Add x509 subject field
*
* \param chain points to the raw certificate data
- * \param subject a string holding (separete with ";"):
+ * \param subject a string holding (separate with ";"):
* CN=CommonName
* -- O=Organization
* -- OU=OrgUnit
]]
---[[
-Return a sorted table of visible childs within a given node
+Return a sorted table of visible children within a given node
@class function
@name node_childs
-- Content-Type. Stores all extracted data associated with its parameter name
-- in the params table within the given message object. Multiple parameter
-- values are stored as tables, ordinary ones as strings.
--- If an optional file callback function is given then it is feeded with the
+-- If an optional file callback function is given then it is fed with the
-- file contents chunk by chunk and only the extracted file name is stored
-- within the params table. The callback function will be called subsequently
-- with three arguments:
-- o Table containing decoded (name, file) and raw (headers) mime header data
-- o String value containing a chunk of the file data
--- o Boolean which indicates wheather the current chunk is the last one (eof)
+-- o Boolean which indicates whether the current chunk is the last one (eof)
function mimedecode_message_body(src, msg, file_cb)
local parser, header, field
local len, maxlen = 0, tonumber(msg.env.CONTENT_LENGTH or nil)
in the params table within the given message object. Multiple parameter
values are stored as tables, ordinary ones as strings.
-If an optional file callback function is given then it is feeded with the
+If an optional file callback function is given then it is fed with the
file contents chunk by chunk and only the extracted file name is stored
within the params table. The callback function will be called subsequently
with three arguments:
o Table containing decoded (name, file) and raw (headers) mime header data
o String value containing a chunk of the file data
- o Boolean which indicates wheather the current chunk is the last one (eof)
+ o Boolean which indicates whether the current chunk is the last one (eof)
@class function
@name mimedecode_message_body
-- cursor factory, modify data (via Cursor.add, Cursor.delete, etc.),
-- save the changes to the staging area via Cursor.save and finally
-- Cursor.commit the data to the actual config files.
--- LuCI then needs to Cursor.apply the changes so deamons etc. are
+-- LuCI then needs to Cursor.apply the changes so daemons etc. are
-- reloaded.
module "luci.model.uci"
cursor factory, modify data (via Cursor.add, Cursor.delete, etc.),
save the changes to the staging area via Cursor.save and finally
Cursor.commit the data to the actual config files.
-LuCI then needs to Cursor.apply the changes so deamons etc. are
+LuCI then needs to Cursor.apply the changes so daemons etc. are
reloaded.
@cstyle instance
]]
---[[
Create a sub-state of this cursor.
-The sub-state is tied to the parent curser, means it the parent unloads or
+The sub-state is tied to the parent cursor, means it the parent unloads or
loads configs, the sub state will do so as well.
@class function
]]
---[[
-Set the directory for uncommited changes.
+Set the directory for uncommitted changes.
@class function
@name Cursor.set_savedir
@class function
@name exec
@param command Command to call
-@return String containg the return the output of the command
+@return String containing the return the output of the command
]]
---[[
@class function
@name getenv
@param var Name of the environment variable to retrieve (optional)
-@return String containg the value of the specified variable
+@return String containing the value of the specified variable
@return Table containing all variables if no variable name is given
]]
]]
---[[
-Retrieve user informations for given uid.
+Retrieve user information for given uid.
@class function
@name getuser
@name user.checkpasswd
@param username String containing the Unix user name
@param pass String containing the password to compare
-@return Boolean indicating wheather the passwords are equal
+@return Boolean indicating whether the passwords are equal
]]
---[[
-- one token per invocation, the tokens are separated by whitespace. If the
-- input value is a table, it is transformed into a string first. A nil value
--- will result in a valid interator which aborts with the first invocation.
+-- will result in a valid iterator which aborts with the first invocation.
function imatch(v)
if type(v) == "table" then
local k = nil
The iterator will return one token per invocation, the tokens are separated by
whitespace. If the input value is a table, it is transformed into a string first.
-A nil value will result in a valid interator which aborts with the first invocation.
+A nil value will result in a valid iterator which aborts with the first invocation.
@class function
@name imatch
]]
---[[
-Strips unnescessary lua bytecode from given string.
+Strips unnecessary lua bytecode from given string.
Information like line numbers and debugging numbers will be discarded.
Original version by Peter Cawley (http://lua-users.org/lists/lua-l/2008-02/msg01158.html)
break;
}
- /* advance beyound the last found valid continuation char */
+ /* advance beyond the last found valid continuation char */
o = v;
ptr += v;
}
--
--- Langauge & Style
+-- Language & Style
--
o = s:taboption("language", ListValue, "_lang", translate("Language"))