2 LuCI Linux and POSIX system utilities.
7 Execute a given shell command and return the error code
11 @param ... Command to call
12 @return Error code of the command
16 Execute a given shell command and capture its standard output
20 @param command Command to call
21 @return String containing the return the output of the command
25 Retrieve information about currently mounted file systems.
29 @return Table containing mount information
33 Retrieve environment variables. If no variable is given then a table
35 containing the whole environment is returned otherwise this function returns
36 the corresponding string value for the given name or nil if no such variable
40 @param var Name of the environment variable to retrieve (optional)
41 @return String containing the value of the specified variable
42 @return Table containing all variables if no variable name is given
46 Get or set the current hostname.
50 @param String containing a new hostname to set (optional)
51 @return String containing the system hostname
55 Returns the contents of a documented referred by an URL.
59 @param url The URL to retrieve
60 @param stream Return a stream instead of a buffer
61 @param target Directly write to target file name
62 @return String containing the contents of given the URL
66 Initiate a system reboot.
70 @return Return value of os.execute()
74 Retrieves the output of the "logread" command.
78 @return String containing the current log buffer
82 Retrieves the output of the "dmesg" command.
86 @return String containing the current log buffer
90 Generates a random id with specified length.
94 @param bytes Number of bytes for the unique id
95 @return String containing hex encoded id
99 Returns the current system uptime stats.
103 @return String containing total uptime in seconds
107 LuCI system utilities / network related functions.
114 Returns the current arp-table entries as two-dimensional table.
118 @return Table of table containing the current arp entries.
119 -- The following fields are defined for arp entry objects:
120 -- { "IP address", "HW address", "HW type", "Flags", "Mask", "Device" }
124 Returns a two-dimensional table of mac address hints.
128 @return Table of table containing known hosts from various sources.
129 Each entry contains the values in the following order:
134 Returns a two-dimensional table of IPv4 address hints.
138 @return Table of table containing known hosts from various sources.
139 Each entry contains the values in the following order:
144 Returns a two-dimensional table of IPv6 address hints.
148 @return Table of table containing known hosts from various sources.
149 Each entry contains the values in the following order:
154 Returns a two-dimensional table of host hints.
158 @return Table of table containing known hosts from various sources,
159 indexed by mac address. Each subtable contains at least one
160 of the fields "name", "ipv4" or "ipv6".
164 Returns conntrack information
168 @return Table with the currently tracked IP connections
172 Determine the names of available network interfaces.
176 @return Table containing all current interface names
180 Return information about available network interfaces.
184 @return Table containing all current interface names and their information
188 Returns the current kernel routing table entries.
192 @return Table of tables with properties of the corresponding routes.
193 -- The following fields are defined for route entry tables:
194 -- { "dest", "gateway", "metric", "refcount", "usecount", "irtt",
195 -- "flags", "device" }
199 Returns the current ipv6 kernel routing table entries.
203 @return Table of tables with properties of the corresponding routes.
204 -- The following fields are defined for route entry tables:
205 -- { "source", "dest", "nexthop", "metric", "refcount", "usecount",
206 -- "flags", "device" }
210 Tests whether the given host responds to ping probes.
214 @param host String containing a hostname or IPv4 address
215 @return Number containing 0 on success and >= 1 on error
219 LuCI system utilities / process related functions.
222 @name luci.sys.process
226 Get the current process id.
230 @return Number containing the current pid
234 Retrieve information about currently running processes.
238 @return Table containing process information
242 Set the gid of a process identified by given pid.
245 @name process.setgroup
246 @param gid Number containing the Unix group id
247 @return Boolean indicating successful operation
248 @return String containing the error message if failed
249 @return Number containing the error code if failed
253 Set the uid of a process identified by given pid.
256 @name process.setuser
257 @param uid Number containing the Unix user id
258 @return Boolean indicating successful operation
259 @return String containing the error message if failed
260 @return Number containing the error code if failed
264 Send a signal to a process identified by given pid.
268 @param pid Number containing the process id
269 @param sig Signal to send (default: 15 [SIGTERM])
270 @return Boolean indicating successful operation
271 @return Number containing the error code if failed
275 LuCI system utilities / user related functions.
282 Retrieve user information for given uid.
286 @param uid Number containing the Unix user id
287 @return Table containing the following fields:
288 -- { "uid", "gid", "name", "passwd", "dir", "shell", "gecos" }
292 Retrieve the current user password hash.
296 @param username String containing the username to retrieve the password for
297 @return String containing the hash or nil if no password is set.
298 @return Password database entry
302 Test whether given string matches the password of a given system user.
305 @name user.checkpasswd
306 @param username String containing the Unix user name
307 @param pass String containing the password to compare
308 @return Boolean indicating whether the passwords are equal
312 Change the password of given user.
316 @param username String containing the Unix user name
317 @param password String containing the password to compare
318 @return Number containing 0 on success and >= 1 on error
322 LuCI system utilities / wifi related functions.
329 Get wireless information for given interface.
333 @param ifname String containing the interface name
334 @return A wrapped iwinfo object instance
338 LuCI system utilities / init related functions.
345 Get the names of all installed init scripts
349 @return Table containing the names of all inistalled init scripts
353 Get the index of he given init script
357 @param name Name of the init script
358 @return Numeric index value
362 Test whether the given init script is enabled
366 @param name Name of the init script
367 @return Boolean indicating whether init is enabled
371 Enable the given init script
375 @param name Name of the init script
376 @return Boolean indicating success
380 Disable the given init script
384 @param name Name of the init script
385 @return Boolean indicating success
389 Start the given init script
393 @param name Name of the init script
394 @return Boolean indicating success
398 Stop the given init script
402 @param name Name of the init script
403 @return Boolean indicating success