2 LuCI Linux and POSIX system utilities.
8 Execute a given shell command and return the error code
12 @param ... Command to call
13 @return Error code of the command
17 Execute a given shell command and capture its standard output
21 @param command Command to call
22 @return String containg the return the output of the command
26 Retrieve information about currently mounted file systems.
30 @return Table containing mount information
34 Retrieve environment variables. If no variable is given then a table
36 containing the whole environment is returned otherwise this function returns
37 the corresponding string value for the given name or nil if no such variable
41 @param var Name of the environment variable to retrieve (optional)
42 @return String containg the value of the specified variable
43 @return Table containing all variables if no variable name is given
47 Get or set the current hostname.
51 @param String containing a new hostname to set (optional)
52 @return String containing the system hostname
56 Returns the contents of a documented referred by an URL.
60 @param url The URL to retrieve
61 @param stream Return a stream instead of a buffer
62 @param target Directly write to target file name
63 @return String containing the contents of given the URL
67 Initiate a system reboot.
71 @return Return value of os.execute()
75 Retrieves the output of the "logread" command.
79 @return String containing the current log buffer
83 Retrieves the output of the "dmesg" command.
87 @return String containing the current log buffer
91 Generates a random id with specified length.
95 @param bytes Number of bytes for the unique id
96 @return String containing hex encoded id
100 Returns the current system uptime stats.
104 @return String containing total uptime in seconds
108 LuCI system utilities / network related functions.
115 Returns the current arp-table entries as two-dimensional table.
119 @return Table of table containing the current arp entries.
120 -- The following fields are defined for arp entry objects:
121 -- { "IP address", "HW address", "HW type", "Flags", "Mask", "Device" }
125 Returns a two-dimensional table of mac address hints.
129 @return Table of table containing known hosts from various sources.
130 Each entry contains the values in the following order:
135 Returns a two-dimensional table of IPv4 address hints.
139 @return Table of table containing known hosts from various sources.
140 Each entry contains the values in the following order:
145 Returns a two-dimensional table of IPv6 address hints.
149 @return Table of table containing known hosts from various sources.
150 Each entry contains the values in the following order:
155 Returns conntrack information
159 @return Table with the currently tracked IP connections
163 Determine the names of available network interfaces.
167 @return Table containing all current interface names
171 Return information about available network interfaces.
175 @return Table containing all current interface names and their information
179 Returns the current kernel routing table entries.
183 @return Table of tables with properties of the corresponding routes.
184 -- The following fields are defined for route entry tables:
185 -- { "dest", "gateway", "metric", "refcount", "usecount", "irtt",
186 -- "flags", "device" }
190 Returns the current ipv6 kernel routing table entries.
194 @return Table of tables with properties of the corresponding routes.
195 -- The following fields are defined for route entry tables:
196 -- { "source", "dest", "nexthop", "metric", "refcount", "usecount",
197 -- "flags", "device" }
201 Tests whether the given host responds to ping probes.
205 @param host String containing a hostname or IPv4 address
206 @return Number containing 0 on success and >= 1 on error
210 LuCI system utilities / process related functions.
213 @name luci.sys.process
217 Get the current process id.
221 @return Number containing the current pid
225 Retrieve information about currently running processes.
229 @return Table containing process information
233 Set the gid of a process identified by given pid.
236 @name process.setgroup
237 @param gid Number containing the Unix group id
238 @return Boolean indicating successful operation
239 @return String containing the error message if failed
240 @return Number containing the error code if failed
244 Set the uid of a process identified by given pid.
247 @name process.setuser
248 @param uid Number containing the Unix user id
249 @return Boolean indicating successful operation
250 @return String containing the error message if failed
251 @return Number containing the error code if failed
255 Send a signal to a process identified by given pid.
259 @param pid Number containing the process id
260 @param sig Signal to send (default: 15 [SIGTERM])
261 @return Boolean indicating successful operation
262 @return Number containing the error code if failed
266 LuCI system utilities / user related functions.
273 Retrieve user informations for given uid.
277 @param uid Number containing the Unix user id
278 @return Table containing the following fields:
279 -- { "uid", "gid", "name", "passwd", "dir", "shell", "gecos" }
283 Retrieve the current user password hash.
287 @param username String containing the username to retrieve the password for
288 @return String containing the hash or nil if no password is set.
289 @return Password database entry
293 Test whether given string matches the password of a given system user.
296 @name user.checkpasswd
297 @param username String containing the Unix user name
298 @param pass String containing the password to compare
299 @return Boolean indicating wheather the passwords are equal
303 Change the password of given user.
307 @param username String containing the Unix user name
308 @param password String containing the password to compare
309 @return Number containing 0 on success and >= 1 on error
313 LuCI system utilities / wifi related functions.
320 Get wireless information for given interface.
324 @param ifname String containing the interface name
325 @return A wrapped iwinfo object instance
329 LuCI system utilities / init related functions.
336 Get the names of all installed init scripts
340 @return Table containing the names of all inistalled init scripts
344 Get the index of he given init script
348 @param name Name of the init script
349 @return Numeric index value
353 Test whether the given init script is enabled
357 @param name Name of the init script
358 @return Boolean indicating whether init is enabled
362 Enable the given init script
366 @param name Name of the init script
367 @return Boolean indicating success
371 Disable the given init script
375 @param name Name of the init script
376 @return Boolean indicating success
380 Start the given init script
384 @param name Name of the init script
385 @return Boolean indicating success
389 Stop the given init script
393 @param name Name of the init script
394 @return Boolean indicating success