1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5 <title>Reference</title>
6 <link rel="stylesheet" href="../luadoc.css" type="text/css" />
7 <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
14 <div id="product_logo"></div>
15 <div id="product_name"><big><b></b></big></div>
16 <div id="product_description"></div>
17 </div> <!-- id="product" -->
27 <li><a href="../index.html">Index</a></li>
38 <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
42 <a href="../modules/luci.http.html">luci.http</a>
46 <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
50 <a href="../modules/luci.http.date.html">luci.http.date</a>
54 <a href="../modules/luci.http.mime.html">luci.http.mime</a>
58 <a href="../modules/luci.i18n.html">luci.i18n</a>
62 <a href="../modules/luci.ip.html">luci.ip</a>
66 <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
70 <a href="../modules/luci.json.html">luci.json</a>
74 <a href="../modules/luci.jsonc.html">luci.jsonc</a>
78 <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
82 <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
86 <a href="../modules/luci.model.uci.html">luci.model.uci</a>
90 <a href="../modules/luci.rpcc.html">luci.rpcc</a>
94 <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
97 <li><strong>luci.sys</strong></li>
100 <a href="../modules/luci.sys.init.html">luci.sys.init</a>
104 <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
108 <a href="../modules/luci.sys.net.html">luci.sys.net</a>
112 <a href="../modules/luci.sys.process.html">luci.sys.process</a>
116 <a href="../modules/luci.sys.user.html">luci.sys.user</a>
120 <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
124 <a href="../modules/luci.util.html">luci.util</a>
128 <a href="../modules/nixio.html">nixio</a>
132 <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
136 <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
140 <a href="../modules/nixio.File.html">nixio.File</a>
144 <a href="../modules/nixio.README.html">nixio.README</a>
148 <a href="../modules/nixio.Socket.html">nixio.Socket</a>
152 <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
156 <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
160 <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
164 <a href="../modules/nixio.bin.html">nixio.bin</a>
168 <a href="../modules/nixio.bit.html">nixio.bit</a>
172 <a href="../modules/nixio.crypto.html">nixio.crypto</a>
176 <a href="../modules/nixio.fs.html">nixio.fs</a>
191 </div><!-- id="navigation" -->
195 <h1>Class <code>luci.sys</code></h1>
206 <table class="function_list">
209 <td class="name" nowrap><a href="#call">call</a> (...)</td>
212 Execute a given shell command and return the error code
217 <td class="name" nowrap><a href="#dmesg">dmesg</a> ()</td>
220 Retrieves the output of the "dmesg" command.</td>
224 <td class="name" nowrap><a href="#exec">exec</a> (command)</td>
227 Execute a given shell command and capture its standard output
232 <td class="name" nowrap><a href="#getenv">getenv</a> (var)</td>
235 Retrieve environment variables.</td>
239 <td class="name" nowrap><a href="#hostname">hostname</a> (String)</td>
242 Get or set the current hostname.</td>
246 <td class="name" nowrap><a href="#httpget">httpget</a> (url, stream, target)</td>
249 Returns the contents of a documented referred by an URL.</td>
253 <td class="name" nowrap><a href="#mounts">mounts</a> ()</td>
256 Retrieve information about currently mounted file systems.</td>
260 <td class="name" nowrap><a href="#reboot">reboot</a> ()</td>
263 Initiate a system reboot.</td>
267 <td class="name" nowrap><a href="#syslog">syslog</a> ()</td>
270 Retrieves the output of the "logread" command.</td>
274 <td class="name" nowrap><a href="#uniqueid">uniqueid</a> (bytes)</td>
277 Generates a random id with specified length.</td>
281 <td class="name" nowrap><a href="#uptime">uptime</a> ()</td>
284 Returns the current system uptime stats.</td>
298 <h2><a name="functions"></a>Functions</h2>
299 <dl class="function">
303 <dt><a name="call"></a><strong>call</strong> (...)</dt>
307 Execute a given shell command and return the error code
325 <h3>Return value:</h3>
326 Error code of the command
335 <dt><a name="dmesg"></a><strong>dmesg</strong> ()</dt>
339 Retrieves the output of the "dmesg" command.
348 <h3>Return value:</h3>
349 String containing the current log buffer
358 <dt><a name="exec"></a><strong>exec</strong> (command)</dt>
362 Execute a given shell command and capture its standard output
370 command: Command to call
380 <h3>Return value:</h3>
381 String containg the return the output of the command
390 <dt><a name="getenv"></a><strong>getenv</strong> (var)</dt>
394 Retrieve environment variables. If no variable is given then a table
396 containing the whole environment is returned otherwise this function returns
397 the corresponding string value for the given name or nil if no such variable
405 var: Name of the environment variable to retrieve (optional)
415 <h3>Return values:</h3>
418 <li>String containg the value of the specified variable
420 <li>Table containing all variables if no variable name is given
431 <dt><a name="hostname"></a><strong>hostname</strong> (String)</dt>
435 Get or set the current hostname.
443 String: containing a new hostname to set (optional)
453 <h3>Return value:</h3>
454 String containing the system hostname
463 <dt><a name="httpget"></a><strong>httpget</strong> (url, stream, target)</dt>
467 Returns the contents of a documented referred by an URL.
475 url: The URL to retrieve
479 stream: Return a stream instead of a buffer
483 target: Directly write to target file name
493 <h3>Return value:</h3>
494 String containing the contents of given the URL
503 <dt><a name="mounts"></a><strong>mounts</strong> ()</dt>
507 Retrieve information about currently mounted file systems.
516 <h3>Return value:</h3>
517 Table containing mount information
526 <dt><a name="reboot"></a><strong>reboot</strong> ()</dt>
530 Initiate a system reboot.
539 <h3>Return value:</h3>
540 Return value of os.execute()
549 <dt><a name="syslog"></a><strong>syslog</strong> ()</dt>
553 Retrieves the output of the "logread" command.
562 <h3>Return value:</h3>
563 String containing the current log buffer
572 <dt><a name="uniqueid"></a><strong>uniqueid</strong> (bytes)</dt>
576 Generates a random id with specified length.
584 bytes: Number of bytes for the unique id
594 <h3>Return value:</h3>
595 String containing hex encoded id
604 <dt><a name="uptime"></a><strong>uptime</strong> ()</dt>
608 Returns the current system uptime stats.
617 <h3>Return value:</h3>
618 String containing total uptime in seconds
631 </div> <!-- id="content" -->
633 </div> <!-- id="main" -->
636 <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
637 </div> <!-- id="about" -->
639 </div> <!-- id="container" -->