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 containg 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 containg 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 conntrack information
158 @return Table with the currently tracked IP connections
162 Determine the names of available network interfaces.
166 @return Table containing all current interface names
170 Return information about available network interfaces.
174 @return Table containing all current interface names and their information
178 Returns the current kernel routing table entries.
182 @return Table of tables with properties of the corresponding routes.
183 -- The following fields are defined for route entry tables:
184 -- { "dest", "gateway", "metric", "refcount", "usecount", "irtt",
185 -- "flags", "device" }
189 Returns the current ipv6 kernel routing table entries.
193 @return Table of tables with properties of the corresponding routes.
194 -- The following fields are defined for route entry tables:
195 -- { "source", "dest", "nexthop", "metric", "refcount", "usecount",
196 -- "flags", "device" }
200 Tests whether the given host responds to ping probes.
204 @param host String containing a hostname or IPv4 address
205 @return Number containing 0 on success and >= 1 on error
209 LuCI system utilities / process related functions.
212 @name luci.sys.process
216 Get the current process id.
220 @return Number containing the current pid
224 Retrieve information about currently running processes.
228 @return Table containing process information
232 Set the gid of a process identified by given pid.
235 @name process.setgroup
236 @param gid Number containing the Unix group id
237 @return Boolean indicating successful operation
238 @return String containing the error message if failed
239 @return Number containing the error code if failed
243 Set the uid of a process identified by given pid.
246 @name process.setuser
247 @param uid Number containing the Unix user id
248 @return Boolean indicating successful operation
249 @return String containing the error message if failed
250 @return Number containing the error code if failed
254 Send a signal to a process identified by given pid.
258 @param pid Number containing the process id
259 @param sig Signal to send (default: 15 [SIGTERM])
260 @return Boolean indicating successful operation
261 @return Number containing the error code if failed
265 LuCI system utilities / user related functions.
272 Retrieve user informations for given uid.
276 @param uid Number containing the Unix user id
277 @return Table containing the following fields:
278 -- { "uid", "gid", "name", "passwd", "dir", "shell", "gecos" }
282 Retrieve the current user password hash.
286 @param username String containing the username to retrieve the password for
287 @return String containing the hash or nil if no password is set.
288 @return Password database entry
292 Test whether given string matches the password of a given system user.
295 @name user.checkpasswd
296 @param username String containing the Unix user name
297 @param pass String containing the password to compare
298 @return Boolean indicating wheather the passwords are equal
302 Change the password of given user.
306 @param username String containing the Unix user name
307 @param password String containing the password to compare
308 @return Number containing 0 on success and >= 1 on error
312 LuCI system utilities / wifi related functions.
319 Get wireless information for given interface.
323 @param ifname String containing the interface name
324 @return A wrapped iwinfo object instance
328 LuCI system utilities / init related functions.
335 Get the names of all installed init scripts
339 @return Table containing the names of all inistalled init scripts
343 Get the index of he given init script
347 @param name Name of the init script
348 @return Numeric index value
352 Test whether the given init script is enabled
356 @param name Name of the init script
357 @return Boolean indicating whether init is enabled
361 Enable the given init script
365 @param name Name of the init script
366 @return Boolean indicating success
370 Disable the given init script
374 @param name Name of the init script
375 @return Boolean indicating success
379 Start the given init script
383 @param name Name of the init script
384 @return Boolean indicating success
388 Stop the given init script
392 @param name Name of the init script
393 @return Boolean indicating success